DepotMapperEx.xml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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.DepotMapperEx">
  4. <resultMap extends="com.jsh.erp.datasource.mappers.DepotMapper.BaseResultMap" id="ResultMapEx" type="com.jsh.erp.datasource.entities.DepotEx">
  5. <result column="principalName" jdbcType="VARCHAR" property="principalName" />
  6. </resultMap>
  7. <select id="selectByConditionDepot" parameterType="com.jsh.erp.datasource.entities.DepotExample" resultMap="ResultMapEx">
  8. select dep.*,usr.username as principalName
  9. FROM jsh_depot dep
  10. left join jsh_user usr on usr.id=dep.principal and ifnull(usr.status,'0') not in('1','2')
  11. where 1=1
  12. <if test="name != null">
  13. <bind name="bindName" value="'%'+name+'%'"/>
  14. and dep.name like #{bindName}
  15. </if>
  16. <if test="type != null">
  17. and dep.type=#{type}
  18. </if>
  19. <if test="remark != null">
  20. <bind name="bindRemark" value="'%'+remark+'%'"/>
  21. and dep.remark like #{bindRemark}
  22. </if>
  23. and ifnull(dep.delete_Flag,'0') !='1'
  24. order by dep.sort asc, dep.id desc
  25. </select>
  26. <update id="batchDeleteDepotByIds">
  27. update jsh_depot
  28. set delete_Flag='1'
  29. where 1=1
  30. and id in (
  31. <foreach collection="ids" item="id" separator=",">
  32. #{id}
  33. </foreach>
  34. )
  35. </update>
  36. </mapper>