Commit ab7d72b9 by 杨林龙

修改插入和修改广告的的SQL语句 yangll

1 parent 40928ed9
......@@ -36,4 +36,6 @@ public interface PlatformCustomerMapper extends OreMapper<PlatformCustomer> {
int register(PlatformCustomer customer);
PlatformCustomer selectOneByAppId(@Param("appId") int appId);
int updateByCustomerId(@Param("id") int id, @Param("password") String password);
}
......@@ -35,12 +35,14 @@ public class AdMgrServiceImpl implements AdMgrService {
@Override
public int insertAd(PlatformAd ad) {
ad.setCreateTime(new Date());
ad.setStatus(1);
return adMapper.insert(ad);
}
@Override
public int updateAd(PlatformAd ad) {
ad.setUpdateTime(new Date());
ad.setStatus(1);
return adMapper.updateByPrimaryKeySelective(ad);
}
......
......@@ -41,10 +41,8 @@ public class CustomerMgrServiceImpl implements CustomerMgrService {
@Override
public int reset(int id) {
PlatformCustomer customer = new PlatformCustomer();
customer.setId(id);
customer.setPassword("12345678");
return customerMapper.updateByPrimaryKeySelective(customer);
String password = "12345678";
return customerMapper.updateByCustomerId(id, password);
}
@Override
......
......@@ -8,10 +8,10 @@
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="title" jdbcType="VARCHAR" property="title"/>
<result column="image" jdbcType="VARCHAR" property="image"/>
<result column="position" jdbcType="TINYINT" property="position"/>
<result column="interface_type" jdbcType="TINYINT" property="interfaceType"/>
<result column="position" jdbcType="INTEGER" property="position"/>
<result column="interface_type" jdbcType="INTEGER" property="interfaceType"/>
<result column="interface_url" jdbcType="VARCHAR" property="interfaceUrl"/>
<result column="status" jdbcType="TINYINT" property="status"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="create_by" jdbcType="INTEGER" property="createBy"/>
......@@ -31,9 +31,20 @@
where id = #{id,jdbcType=INTEGER}
</update>
<select id="getAdMgrList" resultType="cn.com.glsx.openplatform.model.PlatformAd">
<select id="getAdMgrList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
id,
title,
image,
`position`,
interface_type,
interface_url,
`status`,
create_time,
update_time,
create_by,
update_by,
remark
from t_platform_ad
</select>
</mapper>
......@@ -150,6 +150,13 @@
</trim>
</insert>
<update id="updateByCustomerId">
update t_platform_customer
set password = #{password,jdbcType=VARCHAR},
update_time = NOW()
where id = #{id,jdbcType=INTEGER}
</update>
<select id="getCustomerMgrList" resultMap="BaseResultMap">
select a.id,
a.customer_name,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!