FunctionMapperEx.xml 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  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.FunctionMapperEx">
  4. <resultMap extends="com.jsh.erp.datasource.mappers.FunctionMapper.BaseResultMap" id="ResultMapEx" type="com.jsh.erp.datasource.entities.FunctionEx">
  5. <result column="parent_name" jdbcType="VARCHAR" property="parentName" />
  6. </resultMap>
  7. <select id="selectByConditionFunction" parameterType="com.jsh.erp.datasource.entities.FunctionExample"
  8. resultMap="ResultMapEx">
  9. select fa.*, fb.name parent_name
  10. from jsh_function fa
  11. left join jsh_function fb on fa.parent_number = fb.number
  12. where 1=1
  13. <if test="name != null">
  14. <bind name="bindName" value="'%'+name+'%'"/>
  15. and fa.name like #{bindName}
  16. </if>
  17. <if test="type != null">
  18. and fa.type=#{type}
  19. </if>
  20. and ifnull(fa.delete_flag,'0') !='1'
  21. order by fa.sort asc
  22. </select>
  23. <update id="batchDeleteFunctionByIds">
  24. update jsh_function
  25. set delete_flag='1'
  26. where 1=1
  27. and id in (
  28. <foreach collection="ids" item="id" separator=",">
  29. #{id}
  30. </foreach>
  31. )
  32. </update>
  33. </mapper>