TCorpsMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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="com.ruoyi.basicData.mapper.TCorpsMapper">
  6. <resultMap type="TCorps" id="TCorpsResult">
  7. <result property="fId" column="f_id"/>
  8. <result property="fTypeid" column="f_typeid"/>
  9. <result property="fNo" column="f_no"/>
  10. <result property="fName" column="f_name"/>
  11. <result property="fCname" column="f_cname"/>
  12. <result property="fEname" column="f_ename"/>
  13. <result property="fTel" column="f_tel"/>
  14. <result property="fFax" column="f_fax"/>
  15. <result property="fEmail" column="f_email"/>
  16. <result property="fManage" column="f_manage"/>
  17. <result property="fAddr" column="f_addr"/>
  18. <result property="fEaddr" column="f_eaddr"/>
  19. <result property="fScale" column="f_scale"/>
  20. <result property="fProvince" column="f_province"/>
  21. <result property="fCity" column="f_city"/>
  22. <result property="fStltypeid" column="f_stltypeid"/>
  23. <result property="fStldays" column="f_stldays"/>
  24. <result property="fContractno" column="f_contractno"/>
  25. <result property="fContractb" column="f_contractb"/>
  26. <result property="fContracte" column="f_contracte"/>
  27. <result property="fTax" column="f_tax"/>
  28. <result property="fInvtel" column="f_invtel"/>
  29. <result property="fInvaddr" column="f_invaddr"/>
  30. <result property="fBankno" column="f_bankno"/>
  31. <result property="fBankname" column="f_bankname"/>
  32. <result property="fUbankno" column="f_ubankno"/>
  33. <result property="fUbankname" column="f_ubankname"/>
  34. <result property="fStatus" column="f_status"/>
  35. <result property="delFlag" column="del_flag"/>
  36. <result property="createBy" column="create_by"/>
  37. <result property="createTime" column="create_time"/>
  38. <result property="updateBy" column="update_by"/>
  39. <result property="updateTime" column="update_time"/>
  40. <result property="remark" column="remark"/>
  41. </resultMap>
  42. <sql id="selectTCorpsVo">
  43. select f_id, f_typeid, f_no, f_name, f_cname, f_ename, f_tel, f_fax, f_email, f_manage, f_addr, f_eaddr, f_scale, f_province, f_city, f_stltypeid, f_stldays, f_contractno, f_contractb, f_contracte, f_tax, f_invtel, f_invaddr, f_bankno, f_bankname, f_ubankno, f_ubankname, f_status, del_flag, create_by, create_time, update_by, update_time, remark from t_corps
  44. </sql>
  45. <select id="selectTCorpsList" parameterType="TCorps" resultMap="TCorpsResult">
  46. <include refid="selectTCorpsVo"/>
  47. <where>
  48. <if test="fTypeid != null and fTypeid != ''">and f_typeid = #{fTypeid}</if>
  49. <if test="fNo != null and fNo != ''">and f_no like concat('%', #{fNo}, '%')</if>
  50. <if test="fName != null and fName != ''">and f_name like concat('%', #{fName}, '%')</if>
  51. <if test="fCname != null and fCname != ''">and f_cname like concat('%', #{fCname}, '%')</if>
  52. <if test="fEname != null and fEname != ''">and f_ename like concat('%', #{fEname}, '%')</if>
  53. <if test="fTel != null and fTel != ''">and f_tel like concat('%', #{fTel}, '%')</if>
  54. <if test="fFax != null and fFax != ''">and f_fax = #{fFax}</if>
  55. <if test="fEmail != null and fEmail != ''">and f_email = #{fEmail}</if>
  56. <if test="fManage != null and fManage != ''">and f_manage = #{fManage}</if>
  57. <if test="fAddr != null and fAddr != ''">and f_addr = #{fAddr}</if>
  58. <if test="fEaddr != null and fEaddr != ''">and f_eaddr = #{fEaddr}</if>
  59. <if test="fScale != null and fScale != ''">and f_scale = #{fScale}</if>
  60. <if test="fProvince != null and fProvince != ''">and f_province = #{fProvince}</if>
  61. <if test="fCity != null and fCity != ''">and f_city = #{fCity}</if>
  62. <if test="fStltypeid != null ">and f_stltypeid = #{fStltypeid}</if>
  63. <if test="fStldays != null ">and f_stldays = #{fStldays}</if>
  64. <if test="fContractno != null and fContractno != ''">and f_contractno = #{fContractno}</if>
  65. <if test="fContractb != null ">and f_contractb = #{fContractb}</if>
  66. <if test="fContracte != null ">and f_contracte = #{fContracte}</if>
  67. <if test="fTax != null and fTax != ''">and f_tax = #{fTax}</if>
  68. <if test="fInvtel != null and fInvtel != ''">and f_invtel = #{fInvtel}</if>
  69. <if test="fInvaddr != null and fInvaddr != ''">and f_invaddr = #{fInvaddr}</if>
  70. <if test="fBankno != null and fBankno != ''">and f_bankno = #{fBankno}</if>
  71. <if test="fBankname != null and fBankname != ''">and f_bankname like concat('%', #{fBankname}, '%')</if>
  72. <if test="fUbankno != null and fUbankno != ''">and f_ubankno = #{fUbankno}</if>
  73. <if test="fUbankname != null and fUbankname != ''">and f_ubankname like concat('%', #{fUbankname}, '%')
  74. </if>
  75. <if test="fStatus != null and fStatus != ''">and f_status = #{fStatus}</if>
  76. </where>
  77. </select>
  78. <select id="selectTCorpsById" parameterType="Long" resultMap="TCorpsResult">
  79. <include refid="selectTCorpsVo"/>
  80. where f_id = #{fId}
  81. </select>
  82. <insert id="insertTCorps" parameterType="TCorps" useGeneratedKeys="true" keyProperty="fId">
  83. insert into t_corps
  84. <trim prefix="(" suffix=")" suffixOverrides=",">
  85. <if test="fTypeid != null">f_typeid,</if>
  86. <if test="fNo != null and fNo != ''">f_no,</if>
  87. <if test="fName != null and fName != ''">f_name,</if>
  88. <if test="fCname != null">f_cname,</if>
  89. <if test="fEname != null">f_ename,</if>
  90. <if test="fTel != null">f_tel,</if>
  91. <if test="fFax != null">f_fax,</if>
  92. <if test="fEmail != null">f_email,</if>
  93. <if test="fManage != null">f_manage,</if>
  94. <if test="fAddr != null">f_addr,</if>
  95. <if test="fEaddr != null">f_eaddr,</if>
  96. <if test="fScale != null">f_scale,</if>
  97. <if test="fProvince != null">f_province,</if>
  98. <if test="fCity != null">f_city,</if>
  99. <if test="fStltypeid != null">f_stltypeid,</if>
  100. <if test="fStldays != null">f_stldays,</if>
  101. <if test="fContractno != null">f_contractno,</if>
  102. <if test="fContractb != null">f_contractb,</if>
  103. <if test="fContracte != null">f_contracte,</if>
  104. <if test="fTax != null">f_tax,</if>
  105. <if test="fInvtel != null">f_invtel,</if>
  106. <if test="fInvaddr != null">f_invaddr,</if>
  107. <if test="fBankno != null">f_bankno,</if>
  108. <if test="fBankname != null">f_bankname,</if>
  109. <if test="fUbankno != null">f_ubankno,</if>
  110. <if test="fUbankname != null">f_ubankname,</if>
  111. <if test="fStatus != null and fStatus != ''">f_status,</if>
  112. <if test="delFlag != null">del_flag,</if>
  113. <if test="createBy != null">create_by,</if>
  114. <if test="createTime != null">create_time,</if>
  115. <if test="updateBy != null">update_by,</if>
  116. <if test="updateTime != null">update_time,</if>
  117. <if test="remark != null">remark,</if>
  118. </trim>
  119. <trim prefix="values (" suffix=")" suffixOverrides=",">
  120. <if test="fTypeid != null">#{fTypeid},</if>
  121. <if test="fNo != null and fNo != ''">#{fNo},</if>
  122. <if test="fName != null and fName != ''">#{fName},</if>
  123. <if test="fCname != null">#{fCname},</if>
  124. <if test="fEname != null">#{fEname},</if>
  125. <if test="fTel != null">#{fTel},</if>
  126. <if test="fFax != null">#{fFax},</if>
  127. <if test="fEmail != null">#{fEmail},</if>
  128. <if test="fManage != null">#{fManage},</if>
  129. <if test="fAddr != null">#{fAddr},</if>
  130. <if test="fEaddr != null">#{fEaddr},</if>
  131. <if test="fScale != null">#{fScale},</if>
  132. <if test="fProvince != null">#{fProvince},</if>
  133. <if test="fCity != null">#{fCity},</if>
  134. <if test="fStltypeid != null">#{fStltypeid},</if>
  135. <if test="fStldays != null">#{fStldays},</if>
  136. <if test="fContractno != null">#{fContractno},</if>
  137. <if test="fContractb != null">#{fContractb},</if>
  138. <if test="fContracte != null">#{fContracte},</if>
  139. <if test="fTax != null">#{fTax},</if>
  140. <if test="fInvtel != null">#{fInvtel},</if>
  141. <if test="fInvaddr != null">#{fInvaddr},</if>
  142. <if test="fBankno != null">#{fBankno},</if>
  143. <if test="fBankname != null">#{fBankname},</if>
  144. <if test="fUbankno != null">#{fUbankno},</if>
  145. <if test="fUbankname != null">#{fUbankname},</if>
  146. <if test="fStatus != null and fStatus != ''">#{fStatus},</if>
  147. <if test="delFlag != null">#{delFlag},</if>
  148. <if test="createBy != null">#{createBy},</if>
  149. <if test="createTime != null">#{createTime},</if>
  150. <if test="updateBy != null">#{updateBy},</if>
  151. <if test="updateTime != null">#{updateTime},</if>
  152. <if test="remark != null">#{remark},</if>
  153. </trim>
  154. </insert>
  155. <update id="updateTCorps" parameterType="TCorps">
  156. update t_corps
  157. <trim prefix="SET" suffixOverrides=",">
  158. <if test="fTypeid != null">f_typeid = #{fTypeid},</if>
  159. <if test="fNo != null and fNo != ''">f_no = #{fNo},</if>
  160. <if test="fName != null and fName != ''">f_name = #{fName},</if>
  161. <if test="fCname != null">f_cname = #{fCname},</if>
  162. <if test="fEname != null">f_ename = #{fEname},</if>
  163. <if test="fTel != null">f_tel = #{fTel},</if>
  164. <if test="fFax != null">f_fax = #{fFax},</if>
  165. <if test="fEmail != null">f_email = #{fEmail},</if>
  166. <if test="fManage != null">f_manage = #{fManage},</if>
  167. <if test="fAddr != null">f_addr = #{fAddr},</if>
  168. <if test="fEaddr != null">f_eaddr = #{fEaddr},</if>
  169. <if test="fScale != null">f_scale = #{fScale},</if>
  170. <if test="fProvince != null">f_province = #{fProvince},</if>
  171. <if test="fCity != null">f_city = #{fCity},</if>
  172. <if test="fStltypeid != null">f_stltypeid = #{fStltypeid},</if>
  173. <if test="fStldays != null">f_stldays = #{fStldays},</if>
  174. <if test="fContractno != null">f_contractno = #{fContractno},</if>
  175. <if test="fContractb != null">f_contractb = #{fContractb},</if>
  176. <if test="fContracte != null">f_contracte = #{fContracte},</if>
  177. <if test="fTax != null">f_tax = #{fTax},</if>
  178. <if test="fInvtel != null">f_invtel = #{fInvtel},</if>
  179. <if test="fInvaddr != null">f_invaddr = #{fInvaddr},</if>
  180. <if test="fBankno != null">f_bankno = #{fBankno},</if>
  181. <if test="fBankname != null">f_bankname = #{fBankname},</if>
  182. <if test="fUbankno != null">f_ubankno = #{fUbankno},</if>
  183. <if test="fUbankname != null">f_ubankname = #{fUbankname},</if>
  184. <if test="fStatus != null and fStatus != ''">f_status = #{fStatus},</if>
  185. <if test="delFlag != null">del_flag = #{delFlag},</if>
  186. <if test="createBy != null">create_by = #{createBy},</if>
  187. <if test="createTime != null">create_time = #{createTime},</if>
  188. <if test="updateBy != null">update_by = #{updateBy},</if>
  189. <if test="updateTime != null">update_time = #{updateTime},</if>
  190. <if test="remark != null">remark = #{remark},</if>
  191. </trim>
  192. where f_id = #{fId}
  193. </update>
  194. <delete id="deleteTCorpsById" parameterType="Long">
  195. delete from t_corps where f_id = #{fId}
  196. </delete>
  197. <delete id="deleteTCorpsByIds" parameterType="String">
  198. delete from t_corps where f_id in
  199. <foreach item="fId" collection="array" open="(" separator="," close=")">
  200. #{fId}
  201. </foreach>
  202. </delete>
  203. <select id="checkFNoUnique" parameterType="String" resultMap="TCorpsResult">
  204. select f_id,f_no from t_corps where f_no = #{fNo} limit 1
  205. </select>
  206. <select id="checkUFNnameUnique" parameterType="String" resultMap="TCorpsResult">
  207. select f_id,f_name from t_corps where f_name = #{fAame} limit 1
  208. </select>
  209. <select id="checkUFCnameUnique" parameterType="String" resultMap="TCorpsResult">
  210. select f_id,f_addr from t_corps where f_cname = #{fCname} limit 1
  211. </select>
  212. </mapper>