|
|
|
<?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.qs.serve.modules.tzc.mapper.TzcPolicyMapper">
|
|
|
|
|
|
|
|
<resultMap id="tzcPolicyMap" type="com.qs.serve.modules.tzc.entity.TzcPolicy" >
|
|
|
|
<result property="id" column="id"/>
|
|
|
|
<result property="title" column="title"/>
|
|
|
|
<result property="policyCode" column="policy_code"/>
|
|
|
|
<result property="policyStatus" column="policy_status"/>
|
|
|
|
<result property="passTime" column="pass_time"/>
|
|
|
|
<result property="submitTime" column="submit_time"/>
|
|
|
|
<result property="totalItems" column="total_items"/>
|
|
|
|
<result property="totalItemAmount" column="total_item_amount"/>
|
|
|
|
<result property="totalItemUsedAmount" column="total_item_used_amount"/>
|
|
|
|
<result property="supplierId" column="supplier_id"/>
|
|
|
|
<result property="supplierCode" column="supplier_code"/>
|
|
|
|
<result property="supplierName" column="supplier_name"/>
|
|
|
|
<result property="userId" column="user_id"/>
|
|
|
|
<result property="userCode" column="user_code"/>
|
|
|
|
<result property="userName" column="user_name"/>
|
|
|
|
<result property="syFlowId" column="sy_flow_id"/>
|
|
|
|
<result property="syFormId" column="sy_form_id"/>
|
|
|
|
<result property="remark" column="remark"/>
|
|
|
|
<result property="createTime" column="create_time"/>
|
|
|
|
<result property="updateTime" column="update_time"/>
|
|
|
|
<result property="tenantId" column="tenant_id"/>
|
|
|
|
<result property="createBy" column="create_by"/>
|
|
|
|
<result property="updateBy" column="update_by"/>
|
|
|
|
<result property="delFlag" column="del_flag"/>
|
|
|
|
<result property="extUserId" column="ext_user_id"/>
|
|
|
|
<result property="extUserCode" column="ext_user_code"/>
|
|
|
|
<result property="extUserName" column="ext_user_name"/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="tzcPolicySql">
|
|
|
|
tzc_policy.`id`,
|
|
|
|
tzc_policy.`title`,
|
|
|
|
tzc_policy.`policy_code`,
|
|
|
|
tzc_policy.`policy_status`,
|
|
|
|
tzc_policy.`pass_time`,
|
|
|
|
tzc_policy.`submit_time`,
|
|
|
|
tzc_policy.`total_items`,
|
|
|
|
tzc_policy.`total_item_amount`,
|
|
|
|
tzc_policy.`total_item_used_amount`,
|
|
|
|
tzc_policy.`supplier_id`,
|
|
|
|
tzc_policy.`supplier_code`,
|
|
|
|
tzc_policy.`supplier_name`,
|
|
|
|
tzc_policy.`user_id`,
|
|
|
|
tzc_policy.`user_code`,
|
|
|
|
tzc_policy.`user_name`,
|
|
|
|
tzc_policy.`sy_flow_id`,
|
|
|
|
tzc_policy.`sy_form_id`,
|
|
|
|
tzc_policy.`remark`,
|
|
|
|
tzc_policy.`create_time`,
|
|
|
|
tzc_policy.`update_time`,
|
|
|
|
tzc_policy.`tenant_id`,
|
|
|
|
tzc_policy.`create_by`,
|
|
|
|
tzc_policy.`update_by`,
|
|
|
|
tzc_policy.`del_flag`,
|
|
|
|
tzc_policy.`ext_user_id`,
|
|
|
|
tzc_policy.`ext_user_code`,
|
|
|
|
tzc_policy.`ext_user_name` </sql>
|
|
|
|
|
|
|
|
<select id="selectTzcPolicyList" parameterType="com.qs.serve.modules.tzc.entity.TzcPolicy" resultMap="tzcPolicyMap">
|
|
|
|
SELECT
|
|
|
|
<include refid="tzcPolicySql"/>
|
|
|
|
FROM `tzc_policy` `tzc_policy`
|
|
|
|
left join bms_supplier on tzc_policy.supplier_id = bms_supplier.id
|
|
|
|
<where>
|
|
|
|
and tzc_policy.del_flag = 0
|
|
|
|
<if test="query.id != null"> and `tzc_policy`.`id` = #{query.id}</if>
|
|
|
|
<if test="query.title != null and query.title != ''"> and `tzc_policy`.`title` like concat('%',#{query.title},'%') </if>
|
|
|
|
<if test="query.policyCode != null and query.policyCode != ''"> and `tzc_policy`.`policy_code` like concat('%',#{query.policyCode},'%') </if>
|
|
|
|
<if test="query.policyStatus != null"> and `tzc_policy`.`policy_status` = #{query.policyStatus}</if>
|
|
|
|
<if test="query.passTime != null"> and `tzc_policy`.`pass_time` = #{query.passTime}</if>
|
|
|
|
<if test="query.submitTime != null"> and `tzc_policy`.`submit_time` = #{query.submitTime}</if>
|
|
|
|
<if test="query.totalItems != null"> and `tzc_policy`.`total_items` = #{query.totalItems}</if>
|
|
|
|
<if test="query.totalItemAmount != null"> and `tzc_policy`.`total_item_amount` = #{query.totalItemAmount}</if>
|
|
|
|
<if test="query.totalItemUsedAmount != null"> and `tzc_policy`.`total_item_used_amount` = #{query.totalItemUsedAmount}</if>
|
|
|
|
<if test="query.supplierId != null"> and `tzc_policy`.`supplier_id` = #{query.supplierId}</if>
|
|
|
|
<if test="query.supplierCode != null and query.supplierCode != ''"> and `tzc_policy`.`supplier_code` like concat('%',#{query.supplierCode},'%') </if>
|
|
|
|
<if test="query.supplierName != null and query.supplierName != ''"> and `tzc_policy`.`supplier_name` like concat('%',#{query.supplierName},'%') </if>
|
|
|
|
<if test="query.userId != null and query.userId != ''"> and `tzc_policy`.`user_id` = #{query.userId}</if>
|
|
|
|
<if test="query.userCode != null and query.userCode != ''"> and `tzc_policy`.`user_code` like concat('%',#{query.userCode},'%')</if>
|
|
|
|
<if test="query.userName != null and query.userName != ''"> and `tzc_policy`.`user_name` like concat('%',#{query.userName},'%') </if>
|
|
|
|
<if test="query.syFlowId != null and query.syFlowId != ''"> and `tzc_policy`.`sy_flow_id` = #{query.syFlowId}</if>
|
|
|
|
<if test="query.syFormId != null and query.syFormId != ''"> and `tzc_policy`.`sy_form_id` = #{query.syFormId}</if>
|
|
|
|
<if test="query.remark != null and query.remark != ''"> and `tzc_policy`.`remark` = #{query.remark}</if>
|
|
|
|
<if test="query.createTime != null"> and `tzc_policy`.`create_time` = #{query.createTime}</if>
|
|
|
|
<if test="query.updateTime != null"> and `tzc_policy`.`update_time` = #{query.updateTime}</if>
|
|
|
|
<if test="query.extUserId != null and query.extUserId != ''"> and `tzc_policy`.`ext_user_id` = #{query.extUserId}</if>
|
|
|
|
<if test="query.extUserCode != null and query.extUserCode != ''"> and `tzc_policy`.`ext_user_code` = #{query.extUserCode}</if>
|
|
|
|
<if test="query.extUserName != null and query.extUserName != ''"> and `tzc_policy`.`ext_user_name` = #{query.extUserName}</if>
|
|
|
|
|
|
|
|
<if test="query.childUserIds!=null and query.childUserIds.size > 0">
|
|
|
|
and `tzc_policy`.`user_id` in
|
|
|
|
<foreach collection="query.childUserIds" item="selectId" index="i" open="(" close=")" separator=",">
|
|
|
|
#{selectId}
|
|
|
|
</foreach>
|
|
|
|
</if>
|
|
|
|
|
|
|
|
</where>
|
|
|
|
order by create_time desc
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<update id="updateCostExtUserByPolicyIds">
|
|
|
|
update tzc_policy
|
|
|
|
set ext_user_id = #{obj.id},ext_user_code=#{obj.code},ext_user_name=#{obj.name}
|
|
|
|
where del_flag=0 and id in
|
|
|
|
<foreach collection="policyIds" item="selectId" index="i" open="(" close=")" separator=",">
|
|
|
|
#{selectId}
|
|
|
|
</foreach>
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<delete id="cancelCostExtUserByPolicyIds">
|
|
|
|
update vtb_verification set ext_user_id = null,ext_user_id=null,ext_user_name=null where cost_apply_id in
|
|
|
|
<foreach collection="policyIds" item="selectId" index="i" open="(" close=")" separator=",">
|
|
|
|
#{selectId}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
</mapper>
|