标签:final close output char turn har return 发布 esc
Controller
/** * * @Description: 生产物资-指标 发布接口 * @Creator: tangsw * @CreateTime: 2019-12-25 10:37:34 * @Modifier: * @ModifyTime: * @Reasons: * @param output 产品生产产量 * @param capacity 产能利用率 * @param contract 按期履约率 * @param vendor 供应商不良行为处置率 * @return * @throws Exception */ @RequestMapping(value = { "/updStatus/output/publish", "/updStatus/capacity/publish", "/updStatus/contract/publish", "/updStatus/vendor/publish" }) @ResponseBody @OptLog(module = "生产物资-指标", operate = "根据ids更新发布状态") public R updatePublishByIds(@RequestBody List<String> ids) throws Exception { Assert.notNull(ids, "ids不能为空"); Map<String, Object> params = new HashMap<>(); List<Map<String, Object>> list = new ArrayList<>(); for (String id : ids) { Map<String, Object> map = new HashMap<>(); map.put("id", id); map.put("status", PgCommonIndexFinalKV.INDEX_ADMIN_PUBLISH_STATUS); map.put("mdate", new Date()); map.put("muser_id", getCurrentUser().getId()); list.add(map); } params.put("list", list); int n = indexProdcutService.updatePublishByIds(params); return R.ok("生产物资-指标 发布成功", n); }
Service
public int updatePublishByIds( Map<String,Object>params);
ServiceImpl
@Override public int updatePublishByIds(Map<String, Object> params) { return super.dao.updatePublishByIds(params); }
Dao
public int updatePublishByIds(Map<String,Object>params);
sql.xml
<update id="updatePublishByIds" parameterType="java.util.Map"> <foreach collection="list" item="item" index="index" open="begin" close=";end;" separator=";"> update INDEX_PRODCUT <set> <if test="item.status != null and item.status !=‘‘ "> status=#{item.status,jdbcType=VARCHAR}, </if> <if test="item.mdate != null "> mdate=#{item.mdate,jdbcType=TIMESTAMP}, </if> <if test="item.muser_id != null and item.muser_id !=‘‘ "> muser_id=#{item.muser_id,jdbcType=VARCHAR} </if> </set> where id = #{item.id} </foreach> </update>
标签:final close output char turn har return 发布 esc
原文地址:https://www.cnblogs.com/tangshengwei/p/12308269.html