BizSqrEnterpriseApplyMapper.xml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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.chinaitop.depot.sqr.mapper.BizSqrEnterpriseApplyMapper">
  4. <resultMap id="BaseResultMap" type="com.chinaitop.depot.sqr.model.vo.BizSqrEnterpriseApplyVO" >
  5. <id column="id" property="id" jdbcType="VARCHAR" />
  6. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  7. <result column="create_user" property="createUser" jdbcType="VARCHAR" />
  8. <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
  9. <result column="update_user" property="updateUser" jdbcType="VARCHAR" />
  10. <result column="sqr_enterprise_id" property="sqrEnterpriseId" jdbcType="VARCHAR" />
  11. <result column="apply_type" property="applyType" jdbcType="INTEGER" />
  12. <result column="apply_status" property="applyStatus" jdbcType="INTEGER" />
  13. <result column="attachment" property="attachment" jdbcType="VARCHAR" />
  14. <result column="unit_info_id" property="unitInfoId" jdbcType="VARCHAR" />
  15. <result column="storage_expire_time" property="storageExpireTime" jdbcType="TIMESTAMP" />
  16. <result column="reissue_time" property="reissueTime" jdbcType="TIMESTAMP" />
  17. <result column="full_time_staff_count" property="fullTimeStaffCount" jdbcType="INTEGER" />
  18. <result column="certified_storekeeper_count" property="certifiedStorekeeperCount" jdbcType="INTEGER" />
  19. <result column="certified_inspector_count" property="certifiedInspectorCount" jdbcType="INTEGER" />
  20. <result column="warehouse_facility_situation" property="warehouseFacilitySituation" jdbcType="VARCHAR" />
  21. <result column="dwmc" property="dwmc" jdbcType="VARCHAR" />
  22. <result column="dwdm" property="dwdm" jdbcType="VARCHAR" />
  23. <result column="fddbr" property="fddbr" jdbcType="VARCHAR" />
  24. <result column="dwlx" property="dwlx" jdbcType="VARCHAR" />
  25. <result column="zcdz" property="zcdz" jdbcType="VARCHAR" />
  26. <result column="cfs" property="cfs" jdbcType="INTEGER" />
  27. <result column="ygs" property="ygs" jdbcType="INTEGER" />
  28. <result column="DICT_LABEL" property="dictLabel" jdbcType="VARCHAR" />
  29. <result column="audit_status" property="auditStatus" jdbcType="INTEGER" />
  30. </resultMap>
  31. <sql id="Example_Where_Clause" >
  32. <where >
  33. <foreach collection="oredCriteria" item="criteria" separator="or" >
  34. <if test="criteria.valid" >
  35. <trim prefix="(" suffix=")" prefixOverrides="and" >
  36. <foreach collection="criteria.criteria" item="criterion" >
  37. <choose >
  38. <when test="criterion.noValue" >
  39. and ${criterion.condition}
  40. </when>
  41. <when test="criterion.singleValue" >
  42. and ${criterion.condition} #{criterion.value}
  43. </when>
  44. <when test="criterion.betweenValue" >
  45. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  46. </when>
  47. <when test="criterion.listValue" >
  48. and ${criterion.condition}
  49. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  50. #{listItem}
  51. </foreach>
  52. </when>
  53. </choose>
  54. </foreach>
  55. </trim>
  56. </if>
  57. </foreach>
  58. </where>
  59. </sql>
  60. <sql id="Update_By_Example_Where_Clause" >
  61. <where >
  62. <foreach collection="example.oredCriteria" item="criteria" separator="or" >
  63. <if test="criteria.valid" >
  64. <trim prefix="(" suffix=")" prefixOverrides="and" >
  65. <foreach collection="criteria.criteria" item="criterion" >
  66. <choose >
  67. <when test="criterion.noValue" >
  68. and ${criterion.condition}
  69. </when>
  70. <when test="criterion.singleValue" >
  71. and ${criterion.condition} #{criterion.value}
  72. </when>
  73. <when test="criterion.betweenValue" >
  74. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  75. </when>
  76. <when test="criterion.listValue" >
  77. and ${criterion.condition}
  78. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  79. #{listItem}
  80. </foreach>
  81. </when>
  82. </choose>
  83. </foreach>
  84. </trim>
  85. </if>
  86. </foreach>
  87. </where>
  88. </sql>
  89. <select id="findByPage" resultType="Map" resultMap="BaseResultMap">
  90. SELECT
  91. bgqa.id,bui.id unitInfoId, bui.dwmc,bui.dwdm,bui.fddbr,bui.dwlx,bgqa.apply_status,bgqa.apply_type,bgq.audit_status
  92. FROM
  93. province_all.biz_sqr_enterprise_apply bgqa
  94. LEFT JOIN province_all.biz_unit_info bui ON bgqa.unit_info_id = bui.id
  95. LEFT JOIN province_all.biz_audit_request bgq ON bgqa.id = bgq.request_id
  96. where bgqa.apply_type=#{applyType,jdbcType=INTEGER}
  97. <if test="dwmc != null and dwmc != ''">
  98. and bui.dwmc LIKE concat('%', #{dwmc}, '%')
  99. </if>
  100. </select>
  101. <select id="findById" resultType="Map" resultMap="BaseResultMap">
  102. SELECT
  103. A.dwmc,A.id unitInfoId, A.dwdm,A.fddbr,A.dwlx,A.zcdz,A.cfs,A.ygs,A.DICT_LABEL,bgqa.apply_status,bgqa.apply_type,
  104. bse.certified_storekeeper_count ,bse.certified_inspector_count ,bse.warehouse_facility_situation ,
  105. bse.full_time_staff_count ,bse.storage_expire_time ,bse.attachment attachment
  106. FROM
  107. province_all.biz_sqr_enterprise_apply bgqa
  108. left join province_all.biz_sqr_enterprise bse on bgqa.sqr_enterprise_id =bse.id
  109. left join(select bui.id,bui.dwmc,bui.dwdm,bui.fddbr,bui.dwlx,bui.zcdz,bui.cfs,bui.ygs,dict.DICT_LABEL from province_all.biz_unit_info bui left join province_all.dev_dict dict on bui.dwlx = dict.id
  110. <if test="unitInfoId != null and unitInfoId != ''">
  111. where bui.id =#{unitInfoId,jdbcType=VARCHAR}
  112. </if>
  113. )A on bgqa.unit_info_id = A.id
  114. where bgqa.id=#{id,jdbcType=INTEGER} and bgqa.apply_type=#{applyType,jdbcType=INTEGER}
  115. </select>
  116. <insert id="insert" keyProperty="id" useGeneratedKeys="true" parameterType="com.chinaitop.depot.sqr.model.BizSqrEnterpriseApply">
  117. insert into province_all.biz_sqr_enterprise_apply (id,unit_info_id,apply_type,
  118. apply_status,storage_expire_time,sqr_enterprise_id,
  119. create_time,create_user,update_time,update_user)
  120. values (
  121. #{id,jdbcType=INTEGER},
  122. #{unitInfoId,jdbcType=VARCHAR},
  123. #{applyType,jdbcType=INTEGER},
  124. #{applyStatus,jdbcType=INTEGER},
  125. #{storageExpireTime,jdbcType=TIMESTAMP},
  126. #{sqrEnterpriseId,jdbcType=VARCHAR},
  127. #{createTime,jdbcType=TIMESTAMP},
  128. #{createUser,jdbcType=VARCHAR},
  129. #{updateTime,jdbcType=TIMESTAMP},
  130. #{updateUser,jdbcType=VARCHAR}
  131. )
  132. </insert>
  133. <select id="selectRequestfindByApplyId" resultType="java.lang.Integer">
  134. SELECT COUNT(*) FROM province_all.biz_audit_request WHERE type =3 and request_id=#{id,jdbcType=INTEGER}
  135. </select>
  136. <delete id="delete" parameterType="java.lang.Integer">
  137. DELETE FROM province_all.biz_sqr_enterprise_apply WHERE id = #{id,jdbcType=INTEGER}
  138. </delete>
  139. </mapper>