PersonMapperEx.xml 1.0 KB

1234567891011121314151617181920212223242526272829
  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.PersonMapperEx">
  4. <select id="selectByConditionPerson" parameterType="com.jsh.erp.datasource.entities.PersonExample" resultMap="com.jsh.erp.datasource.mappers.PersonMapper.BaseResultMap">
  5. select *
  6. FROM jsh_person
  7. where 1=1
  8. <if test="name != null and name != ''">
  9. <bind name="bindName" value="'%'+name+'%'"/>
  10. and name like #{bindName}
  11. </if>
  12. <if test="type != null and type != ''">
  13. and type=#{type}
  14. </if>
  15. and ifnull(delete_flag,'0') !='1'
  16. order by sort asc, id desc
  17. </select>
  18. <update id="batchDeletePersonByIds">
  19. update jsh_person
  20. set delete_flag='1'
  21. where 1=1
  22. and id in (
  23. <foreach collection="ids" item="id" separator=",">
  24. #{id}
  25. </foreach>
  26. )
  27. </update>
  28. </mapper>