| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.chinaitop.depot.sqr.mapper.BizSqrEnterpriseApplyMapper">
- <resultMap id="BaseResultMap" type="com.chinaitop.depot.sqr.model.vo.BizSqrEnterpriseApplyVO" >
- <id column="id" property="id" jdbcType="VARCHAR" />
- <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
- <result column="create_user" property="createUser" jdbcType="VARCHAR" />
- <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
- <result column="update_user" property="updateUser" jdbcType="VARCHAR" />
- <result column="sqr_enterprise_id" property="sqrEnterpriseId" jdbcType="VARCHAR" />
- <result column="apply_type" property="applyType" jdbcType="INTEGER" />
- <result column="apply_status" property="applyStatus" jdbcType="INTEGER" />
- <result column="attachment" property="attachment" jdbcType="VARCHAR" />
- <result column="unitInfoId" property="unitInfoId" jdbcType="VARCHAR" />
- <result column="storage_expire_time" property="storageExpireTime" jdbcType="TIMESTAMP" />
- <result column="reissue_time" property="reissueTime" jdbcType="TIMESTAMP" />
- <result column="full_time_staff_count" property="fullTimeStaffCount" jdbcType="INTEGER" />
- <result column="certified_storekeeper_count" property="certifiedStorekeeperCount" jdbcType="INTEGER" />
- <result column="certified_inspector_count" property="certifiedInspectorCount" jdbcType="INTEGER" />
- <result column="warehouse_facility_situation" property="warehouseFacilitySituation" jdbcType="VARCHAR" />
- <result column="dwmc" property="dwmc" jdbcType="VARCHAR" />
- <result column="dwdm" property="dwdm" jdbcType="VARCHAR" />
- <result column="fddbr" property="fddbr" jdbcType="VARCHAR" />
- <result column="dwlx" property="dwlx" jdbcType="VARCHAR" />
- <result column="zcdz" property="zcdz" jdbcType="VARCHAR" />
- <result column="cfs" property="cfs" jdbcType="INTEGER" />
- <result column="ygs" property="ygs" jdbcType="INTEGER" />
- <result column="DICT_LABEL" property="dictLabel" jdbcType="VARCHAR" />
- <result column="audit_status" property="auditStatus" jdbcType="INTEGER" />
- </resultMap>
- <sql id="Example_Where_Clause" >
- <where >
- <foreach collection="oredCriteria" item="criteria" separator="or" >
- <if test="criteria.valid" >
- <trim prefix="(" suffix=")" prefixOverrides="and" >
- <foreach collection="criteria.criteria" item="criterion" >
- <choose >
- <when test="criterion.noValue" >
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue" >
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue" >
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue" >
- and ${criterion.condition}
- <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Update_By_Example_Where_Clause" >
- <where >
- <foreach collection="example.oredCriteria" item="criteria" separator="or" >
- <if test="criteria.valid" >
- <trim prefix="(" suffix=")" prefixOverrides="and" >
- <foreach collection="criteria.criteria" item="criterion" >
- <choose >
- <when test="criterion.noValue" >
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue" >
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue" >
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue" >
- and ${criterion.condition}
- <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <select id="findByPage" resultType="Map" resultMap="BaseResultMap">
- SELECT
- bgqa.id,A.id unitInfoId,A.dwmc,A.dwdm,A.fddbr,A.dwlx,A.DICT_LABEL,bgqa.apply_status,bgqa.apply_type,bgq.audit_status,bgqa.sqr_enterprise_id
- FROM
- province_all.biz_sqr_enterprise_apply bgqa
- 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)A ON bgqa.unit_info_id = A.id
- LEFT JOIN province_all.biz_audit_request bgq ON bgqa.id = bgq.request_id
- where bgqa.apply_type=#{applyType,jdbcType=INTEGER}
- <if test="dwmc != null and dwmc != ''">
- and bui.dwmc LIKE concat('%', #{dwmc}, '%')
- </if>
- ORDER BY bgqa.id desc
-
- </select>
- <select id="findById" resultType="Map" resultMap="BaseResultMap">
- SELECT DISTINCT
- bui.dwmc,
- bui.id unitInfoId,
- bui.dwdm,
- bui.fddbr,
- bui.dwlx,
- bui.zcdz,
- bui.cfs,
- bui.ygs,
- dict.DICT_LABEL,
- bse.certified_storekeeper_count,
- bse.certified_inspector_count,
- bse.warehouse_facility_situation,
- bse.full_time_staff_count,
- bse.storage_expire_time,
- bse.attachment attachment,
- SUM(oi.depot_area) depotArea,
- SUM(bs.actual_capacity)actualCapacity,
- bgqa.apply_status,bgqa.apply_type,bgqa.id
- FROM
- province_all.biz_unit_info bui
- LEFT JOIN province_all.dev_dict dict ON bui.dwlx = dict.id
- LEFT JOIN province_all.biz_sqr_enterprise bse ON bse.unit_info_id = bui.id
- left join province_all.biz_sqr_enterprise_apply bgqa on bgqa.sqr_enterprise_id =bse.id
- left join depot_qh.org_info oi on oi.unit_info_id=bui.id
- left join depot_qh.basic_storehouse bs on bs.org_id=oi.org_id
- WHERE
- bui.delete_flag = 'NOT_DELETE'
- and bui.id =#{unitInfoId,jdbcType=VARCHAR}
- </select>
- <select id="findById1" resultType="Map" resultMap="BaseResultMap">
- SELECT
- bgqa.id, 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,
- bse.certified_storekeeper_count ,bse.certified_inspector_count ,bse.warehouse_facility_situation ,
- bse.full_time_staff_count ,bgqa.storage_expire_time ,bgqa.attachment attachment,bgqa.sqr_enterprise_id
- FROM
- province_all.biz_sqr_enterprise_apply bgqa
- left join province_all.biz_sqr_enterprise bse on bgqa.sqr_enterprise_id =bse.id
- 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
- <if test="unitInfoId != null and unitInfoId != ''">
- where bui.id =#{unitInfoId,jdbcType=VARCHAR}
- </if>
- )A on bgqa.unit_info_id = A.id
- where bgqa.id=#{id,jdbcType=INTEGER} and bgqa.apply_type=#{applyType,jdbcType=INTEGER}
- </select>
- <select id="findById4" resultType="Map" resultMap="BaseResultMap">
- SELECT
- bgqa.id, 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,
- bgqa.certified_storekeeper_count ,bgqa.certified_inspector_count ,bgqa.warehouse_facility_situation ,bgqa.reissue_time,
- bgqa.full_time_staff_count ,bgqa.storage_expire_time ,bgqa.attachment attachment,bgqa.sqr_enterprise_id
- FROM
- province_all.biz_sqr_enterprise_apply bgqa
- left join province_all.biz_sqr_enterprise bse on bgqa.sqr_enterprise_id =bse.id
- 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
- <if test="unitInfoId != null and unitInfoId != ''">
- where bui.id =#{unitInfoId,jdbcType=VARCHAR}
- </if>
- )A on bgqa.unit_info_id = A.id
- where bgqa.id=#{id,jdbcType=INTEGER} and bgqa.apply_type=#{applyType,jdbcType=INTEGER}
- </select>
- <insert id="insert" keyProperty="id" useGeneratedKeys="true" parameterType="com.chinaitop.depot.sqr.model.BizSqrEnterpriseApply">
- insert into province_all.biz_sqr_enterprise_apply (id,unit_info_id,apply_type,
- apply_status,storage_expire_time,attachment,sqr_enterprise_id,reissue_time,full_time_staff_count,
- certified_inspector_count,certified_storekeeper_count,warehouse_facility_situation,
- create_time,create_user,update_time,update_user)
- values (
- #{id,jdbcType=INTEGER},
- #{unitInfoId,jdbcType=VARCHAR},
- #{applyType,jdbcType=INTEGER},
- #{applyStatus,jdbcType=INTEGER},
- #{storageExpireTime,jdbcType=TIMESTAMP},
- #{attachment,jdbcType=VARCHAR},
- #{sqrEnterpriseId,jdbcType=VARCHAR},
- #{reissueTime,jdbcType=TIMESTAMP},
- #{fullTimeStaffCount,jdbcType=INTEGER},
- #{certifiedInspectorCount,jdbcType=INTEGER},
- #{certifiedStorekeeperCount,jdbcType=INTEGER},
- #{warehouseFacilitySituation,jdbcType=VARCHAR},
- #{createTime,jdbcType=TIMESTAMP},
- #{createUser,jdbcType=VARCHAR},
- #{updateTime,jdbcType=TIMESTAMP},
- #{updateUser,jdbcType=VARCHAR}
- )
- </insert>
- <select id="selectRequestfindByApplyId" resultType="java.lang.Integer">
- SELECT COUNT(*) FROM province_all.biz_audit_request WHERE type =3 and request_id=#{id,jdbcType=INTEGER}
- </select>
- <delete id="delete" parameterType="java.lang.Integer">
- DELETE FROM province_all.biz_sqr_enterprise_apply WHERE id = #{id,jdbcType=INTEGER}
- </delete>
- </mapper>
|