Commit ab7d72b9 by 杨林龙

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

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