WorkCopyV1ServiceDaoImplMapper.xml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="workCopyV1ServiceDaoImpl">
  6. <!-- 保存工作单抄送信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveWorkCopyInfo" parameterType="Map">
  8. insert into work_copy(
  9. copy_id,staff_name,state,community_id,store_id,work_id,staff_id
  10. ) values (
  11. #{copyId},#{staffName},#{state},#{communityId},#{storeId},#{workId},#{staffId}
  12. )
  13. </insert>
  14. <!-- 查询工作单抄送信息 add by wuxw 2018-07-03 -->
  15. <select id="getWorkCopyInfo" parameterType="Map" resultType="Map">
  16. select t.copy_id,t.copy_id copyId,t.staff_name,t.staff_name staffName,t.status_cd,t.status_cd
  17. statusCd,t.state,t.community_id,t.community_id communityId,t.store_id,t.store_id storeId,t.work_id,t.work_id
  18. workId,t.staff_id,t.staff_id staffId,t.create_time createTime,td.`name` stateName
  19. from work_copy t
  20. left join t_dict td on t.state = td.status_cd and td.table_name = 'work_pool' and td.table_columns = 'state'
  21. where 1 =1
  22. <if test="copyId !=null and copyId != ''">
  23. and t.copy_id= #{copyId}
  24. </if>
  25. <if test="staffName !=null and staffName != ''">
  26. and t.staff_name= #{staffName}
  27. </if>
  28. <if test="staffNameLike !=null and staffNameLike != ''">
  29. and t.staff_name like concat('%', #{staffNameLike},'%')
  30. </if>
  31. <if test="statusCd !=null and statusCd != ''">
  32. and t.status_cd= #{statusCd}
  33. </if>
  34. <if test="state !=null and state != ''">
  35. and t.state= #{state}
  36. </if>
  37. <if test="communityId !=null and communityId != ''">
  38. and t.community_id= #{communityId}
  39. </if>
  40. <if test="storeId !=null and storeId != ''">
  41. and t.store_id= #{storeId}
  42. </if>
  43. <if test="workId !=null and workId != ''">
  44. and t.work_id= #{workId}
  45. </if>
  46. <if test="workIds !=null ">
  47. and t.work_id in
  48. <foreach collection="workIds" item="item" open="(" close=")" separator=",">
  49. #{item}
  50. </foreach>
  51. </if>
  52. <if test="staffId !=null and staffId != ''">
  53. and t.staff_id= #{staffId}
  54. </if>
  55. order by t.create_time desc
  56. <if test="page != -1 and page != null ">
  57. limit #{page}, #{row}
  58. </if>
  59. </select>
  60. <!-- 修改工作单抄送信息 add by wuxw 2018-07-03 -->
  61. <update id="updateWorkCopyInfo" parameterType="Map">
  62. update work_copy t set t.status_cd = #{statusCd}
  63. <if test="newBId != null and newBId != ''">
  64. ,t.b_id = #{newBId}
  65. </if>
  66. <if test="staffName !=null and staffName != ''">
  67. , t.staff_name= #{staffName}
  68. </if>
  69. <if test="state !=null and state != ''">
  70. , t.state= #{state}
  71. </if>
  72. <if test="staffId !=null and staffId != ''">
  73. , t.staff_id= #{staffId}
  74. </if>
  75. where 1=1
  76. <if test="copyId !=null and copyId != ''">
  77. and t.copy_id= #{copyId}
  78. </if>
  79. <if test="communityId !=null and communityId != ''">
  80. and t.community_id= #{communityId}
  81. </if>
  82. <if test="storeId !=null and storeId != ''">
  83. and t.store_id= #{storeId}
  84. </if>
  85. <if test="workId !=null and workId != ''">
  86. and t.work_id= #{workId}
  87. </if>
  88. </update>
  89. <!-- 查询工作单抄送数量 add by wuxw 2018-07-03 -->
  90. <select id="queryWorkCopysCount" parameterType="Map" resultType="Map">
  91. select count(1) count
  92. from work_copy t
  93. where 1 =1
  94. <if test="copyId !=null and copyId != ''">
  95. and t.copy_id= #{copyId}
  96. </if>
  97. <if test="staffName !=null and staffName != ''">
  98. and t.staff_name= #{staffName}
  99. </if>
  100. <if test="staffNameLike !=null and staffNameLike != ''">
  101. and t.staff_name like concat('%', #{staffNameLike},'%')
  102. </if>
  103. <if test="statusCd !=null and statusCd != ''">
  104. and t.status_cd= #{statusCd}
  105. </if>
  106. <if test="state !=null and state != ''">
  107. and t.state= #{state}
  108. </if>
  109. <if test="communityId !=null and communityId != ''">
  110. and t.community_id= #{communityId}
  111. </if>
  112. <if test="storeId !=null and storeId != ''">
  113. and t.store_id= #{storeId}
  114. </if>
  115. <if test="workId !=null and workId != ''">
  116. and t.work_id= #{workId}
  117. </if>
  118. <if test="workIds !=null ">
  119. and t.work_id in
  120. <foreach collection="workIds" item="item" open="(" close=")" separator=",">
  121. #{item}
  122. </foreach>
  123. </if>
  124. <if test="staffId !=null and staffId != ''">
  125. and t.staff_id= #{staffId}
  126. </if>
  127. </select>
  128. </mapper>