EmailTemplateDataRuleMapper.xml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.simuwang.base.mapper.EmailTemplateDataRuleMapper">
  4. <resultMap id="BaseResultMap" type="com.simuwang.base.pojo.dos.EmailTemplateDataRuleDO">
  5. <id column="id" property="id"/>
  6. <result column="template_id" property="templateId"/>
  7. <result column="field_name" property="fieldName"/>
  8. <result column="position" property="position"/>
  9. <result column="row" property="row"/>
  10. <result column="column" property="column"/>
  11. <result column="field_rule" property="fieldRule"/>
  12. <result column="unit_convert" property="unitConvert"/>
  13. <result column="isvalid" property="isvalid"/>
  14. <result column="creatorid" property="creatorId"/>
  15. <result column="createtime" property="createTime"/>
  16. <result column="updaterid" property="updaterId"/>
  17. <result column="updatetime" property="updateTime"/>
  18. </resultMap>
  19. <insert id="batchInsert">
  20. insert into PPW_EMAIL.email_template_data_rule(template_id,field_name,position,row,column,field_rule,unit_convert,isvalid,creatorid,createtime,updaterid,updatetime)
  21. values
  22. <foreach collection="itemDoList" item="itemDo" index="index" separator=",">
  23. (#{itemDo.templateId},#{itemDo.fieldName},#{itemDo.position},#{itemDo.row},#{itemDo.column},#{itemDo.fieldRule},#{itemDo.unitConvert},
  24. #{itemDo.isvalid}, #{itemDo.creatorId}, #{itemDo.createTime}, #{itemDo.updaterId}, #{itemDo.updateTime})
  25. </foreach>
  26. </insert>
  27. <update id="batchUpdate">
  28. <foreach collection="itemDoList" item="itemDo" index="index" open="" close="" separator=";">
  29. update PPW_EMAIL.email_template_data_rule
  30. <set>
  31. template_id=#{itemDo.templateId},
  32. field_name = #{itemDo.fieldName},
  33. position=#{itemDo.position},
  34. row=#{itemDo.row},
  35. column=#{itemDo.column},
  36. field_rule=#{itemDo.fieldRule},
  37. unit_convert=#{itemDo.unitConvert},
  38. updatetime=#{itemDo.updateTime},
  39. updaterid=#{itemDo.updaterId}
  40. </set>
  41. where isvalid = 1 and id=#{itemDo.id}
  42. </foreach>
  43. </update>
  44. <update id="deleteByTemplateId">
  45. update PPW_EMAIL.email_template_data_rule set isvalid=0,updatetime=sysdate(),updaterid=#{userId}
  46. where isvalid=1 and template_id in
  47. <foreach collection="templateIdList" index="index" item="templateId" open="(" separator="," close=")">
  48. #{templateId}
  49. </foreach>
  50. </update>
  51. <select id="queryByTemplateId" resultMap="BaseResultMap">
  52. select *
  53. from PPW_EMAIL.email_template_data_rule
  54. where isvalid = 1
  55. and template_id in
  56. <foreach collection="templateIdList" index="index" item="templateId" open="(" separator="," close=")">
  57. #{templateId}
  58. </foreach>
  59. </select>
  60. </mapper>