SupplierMapperEx.xml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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.SupplierMapperEx">
  4. <select id="selectByConditionSupplier" parameterType="com.jsh.erp.datasource.entities.SupplierExample" resultMap="com.jsh.erp.datasource.mappers.SupplierMapper.BaseResultMap">
  5. select *
  6. FROM jsh_supplier
  7. where 1=1
  8. <if test="supplier != null and supplier !=''">
  9. <bind name="bindSupplier" value="'%'+supplier+'%'"/>
  10. and supplier like #{bindSupplier}
  11. </if>
  12. <if test="type != null and type !=''">
  13. and type=#{type}
  14. </if>
  15. <if test="phonenum != null and phonenum !=''">
  16. <bind name="bindPhoneNum" value="'%'+phonenum+'%'"/>
  17. and phone_num like #{bindPhoneNum}
  18. </if>
  19. <if test="telephone != null and telephone !=''">
  20. <bind name="bindTelephone" value="'%'+telephone+'%'"/>
  21. and telephone like #{bindTelephone}
  22. </if>
  23. <if test="creatorArray != null">
  24. and creator in (
  25. <foreach collection="creatorArray" item="creator" separator=",">
  26. #{creator}
  27. </foreach>
  28. )
  29. </if>
  30. and ifnull(delete_flag,'0') !='1'
  31. order by sort asc, id desc
  32. </select>
  33. <select id="findByAll" parameterType="com.jsh.erp.datasource.entities.SupplierExample" resultMap="com.jsh.erp.datasource.mappers.SupplierMapper.BaseResultMap">
  34. select *
  35. FROM jsh_supplier
  36. where 1=1
  37. <if test="supplier != null and supplier !=''">
  38. <bind name="bindSupplier" value="'%'+supplier+'%'"/>
  39. and supplier like #{bindSupplier}
  40. </if>
  41. <if test="type != null and type !=''">
  42. and type=#{type}
  43. </if>
  44. <if test="phonenum != null and phonenum !=''">
  45. <bind name="bindPhoneNum" value="'%'+phonenum+'%'"/>
  46. and phone_num like #{bindPhoneNum}
  47. </if>
  48. <if test="telephone != null and telephone !=''">
  49. <bind name="bindTelephone" value="'%'+telephone+'%'"/>
  50. and telephone like #{bindTelephone}
  51. </if>
  52. and ifnull(delete_flag,'0') !='1'
  53. order by sort asc, id desc
  54. </select>
  55. <update id="batchDeleteSupplierByIds">
  56. update jsh_supplier
  57. set delete_flag='1'
  58. where 1=1
  59. and id in (
  60. <foreach collection="ids" item="id" separator=",">
  61. #{id}
  62. </foreach>
  63. )
  64. </update>
  65. <select id="getSupplierByNameAndType" resultType="com.jsh.erp.datasource.entities.Supplier">
  66. select *
  67. from jsh_supplier
  68. where supplier = #{supplier} and type = #{type}
  69. and ifnull(delete_flag,'0') !='1'
  70. </select>
  71. </mapper>