UnitMapperEx.xml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  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.jsh.erp.datasource.mappers.UnitMapperEx">
  4. <select id="selectByConditionUnit" parameterType="com.jsh.erp.datasource.entities.UnitExample" resultMap="com.jsh.erp.datasource.mappers.UnitMapper.BaseResultMap">
  5. select *
  6. FROM jsh_unit
  7. where 1=1
  8. <if test="name != null">
  9. <bind name="bindName" value="'%'+name+'%'"/>
  10. and name like #{bindName}
  11. </if>
  12. and ifnull(delete_flag,'0') !='1'
  13. order by id desc
  14. </select>
  15. <update id="batchDeleteUnitByIds">
  16. update jsh_unit
  17. set delete_flag='1'
  18. where 1=1
  19. and id in (
  20. <foreach collection="ids" item="id" separator=",">
  21. #{id}
  22. </foreach>
  23. )
  24. </update>
  25. <update id="updateRatioTwoById">
  26. update jsh_unit
  27. set ratio_two=null
  28. where id=#{id}
  29. </update>
  30. <update id="updateRatioThreeById">
  31. update jsh_unit
  32. set ratio_three=null
  33. where id=#{id}
  34. </update>
  35. </mapper>