Commit f6530746 by 杨林龙

修改客户重置状态SQL语句 yangll

1 parent ab7d72b9
...@@ -32,7 +32,7 @@ public interface CustomerMgrService { ...@@ -32,7 +32,7 @@ public interface CustomerMgrService {
* @param status * @param status
* @return * @return
*/ */
int startAndStop(int id, int status); Integer startAndStop(Integer id, Integer status);
/** /**
* 客户总数据 * 客户总数据
......
...@@ -20,4 +20,6 @@ public interface PlatformAdMapper extends OreMapper<PlatformAd> { ...@@ -20,4 +20,6 @@ public interface PlatformAdMapper extends OreMapper<PlatformAd> {
List<PlatformAd> getAdMgrList(); List<PlatformAd> getAdMgrList();
int updateById(@Param("id") int id, @Param("status") int status); int updateById(@Param("id") int id, @Param("status") int status);
int updateByAdId(PlatformAd ad);
} }
\ No newline at end of file \ No newline at end of file
...@@ -38,4 +38,6 @@ public interface PlatformCustomerMapper extends OreMapper<PlatformCustomer> { ...@@ -38,4 +38,6 @@ public interface PlatformCustomerMapper extends OreMapper<PlatformCustomer> {
PlatformCustomer selectOneByAppId(@Param("appId") int appId); PlatformCustomer selectOneByAppId(@Param("appId") int appId);
int updateByCustomerId(@Param("id") int id, @Param("password") String password); int updateByCustomerId(@Param("id") int id, @Param("password") String password);
Integer updateStatusByCustomerId(@Param("id") Integer id, @Param("status") Integer status);
} }
...@@ -42,8 +42,9 @@ public class AdMgrServiceImpl implements AdMgrService { ...@@ -42,8 +42,9 @@ public class AdMgrServiceImpl implements AdMgrService {
@Override @Override
public int updateAd(PlatformAd ad) { public int updateAd(PlatformAd ad) {
ad.setUpdateTime(new Date()); ad.setUpdateTime(new Date());
ad.setStatus(1); int i = adMapper.updateByAdId(ad);
return adMapper.updateByPrimaryKeySelective(ad); LOGGER.info("=i========" + i);
return i;
} }
@Override @Override
......
...@@ -46,11 +46,8 @@ public class CustomerMgrServiceImpl implements CustomerMgrService { ...@@ -46,11 +46,8 @@ public class CustomerMgrServiceImpl implements CustomerMgrService {
} }
@Override @Override
public int startAndStop(int id, int status) { public Integer startAndStop(Integer id, Integer status) {
PlatformCustomer customer = new PlatformCustomer(); return customerMapper.updateStatusByCustomerId(id,status);
customer.setId(id);
customer.setStatus(status);
return customerMapper.updateByPrimaryKeySelective(customer);
} }
@Override @Override
......
...@@ -47,4 +47,46 @@ ...@@ -47,4 +47,46 @@
remark remark
from t_platform_ad from t_platform_ad
</select> </select>
<update id="updateByAdId" parameterType="cn.com.glsx.openplatform.model.PlatformAd">
<!--@mbg.generated-->
update t_platform_ad
<set>
<if test="title != null and title != ''">
title = #{title,jdbcType=VARCHAR},
</if>
<if test="image != null and image != ''">
image = #{image,jdbcType=VARCHAR},
</if>
<if test="position != null">
`position` = #{position,jdbcType=TINYINT},
</if>
<if test="interfaceType != null">
interface_type = #{interfaceType,jdbcType=TINYINT},
</if>
<if test="interfaceUrl != null and interfaceUrl != ''">
interface_url = #{interfaceUrl,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=TINYINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=INTEGER},
</if>
<if test="remark != null and remark != ''">
remark = #{remark,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
</mapper> </mapper>
...@@ -157,6 +157,13 @@ ...@@ -157,6 +157,13 @@
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
<update id="updateStatusByCustomerId">
update t_platform_customer
set status = #{status,jdbcType=INTEGER},
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,
......
...@@ -42,4 +42,10 @@ public class CustomerMgrServiceImplTest { ...@@ -42,4 +42,10 @@ public class CustomerMgrServiceImplTest {
List<Area> addressOptionList = customerMgrService.getAddressOptionList(0); List<Area> addressOptionList = customerMgrService.getAddressOptionList(0);
System.out.println("addressOptionList = " + addressOptionList.toString()); System.out.println("addressOptionList = " + addressOptionList.toString());
} }
@Test
public void test2() {
int i = customerMgrService.startAndStop(3, 0);
System.out.println("i = " + i);
}
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!