<?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="org.sxkj.gd.orderdata.mapper.GdSupplyDemandMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="gdSupplyDemandResultMap" type="org.sxkj.gd.orderdata.entity.GdSupplyDemandEntity">
|
<result column="id" property="id"/>
|
<result column="demand_name" property="demandName"/>
|
<result column="demand_type" property="demandType"/>
|
<result column="contact_person" property="contactPerson"/>
|
<result column="contact_phone" property="contactPhone"/>
|
<result column="contact_email" property="contactEmail"/>
|
<result column="demand_status" property="demandStatus"/>
|
<result column="update_cycle" property="updateCycle"/>
|
<result column="apply_basis" property="applyBasis"/>
|
<result column="share_type" property="shareType"/>
|
<result column="application_scene" property="applicationScene"/>
|
<result column="responsible_dept_id" property="responsibleDeptId"/>
|
<result column="apply_target_dept_id" property="applyTargetDeptId"/>
|
<result column="data_source" property="dataSource"/>
|
<result column="demand_info" property="demandInfo"/>
|
<result column="area_code" property="areaCode"/>
|
<result column="create_user" property="createUser"/>
|
<result column="create_dept" property="createDept"/>
|
<result column="create_time" property="createTime"/>
|
<result column="update_user" property="updateUser"/>
|
<result column="update_time" property="updateTime"/>
|
<result column="status" property="status"/>
|
<result column="is_deleted" property="isDeleted"/>
|
</resultMap>
|
|
<resultMap id="gdSupplyDemandVOResultMap" type="org.sxkj.gd.orderdata.vo.GdSupplyDemandVO" extends="gdSupplyDemandResultMap"/>
|
|
<sql id="gdSupplyDemandCondition">
|
<if test="param.id != null">
|
AND id = #{param.id}
|
</if>
|
<if test="param.demandName != null and param.demandName != ''">
|
AND demand_name = #{param.demandName}
|
</if>
|
<if test="param.demandType != null and param.demandType != ''">
|
AND demand_type = #{param.demandType}
|
</if>
|
<if test="param.contactPerson != null and param.contactPerson != ''">
|
AND contact_person = #{param.contactPerson}
|
</if>
|
<if test="param.contactPhone != null and param.contactPhone != ''">
|
AND contact_phone = #{param.contactPhone}
|
</if>
|
<if test="param.contactEmail != null and param.contactEmail != ''">
|
AND contact_email = #{param.contactEmail}
|
</if>
|
<if test="param.demandStatus != null and param.demandStatus != ''">
|
AND demand_status = #{param.demandStatus}
|
</if>
|
<if test="param.updateCycle != null and param.updateCycle != ''">
|
AND update_cycle = #{param.updateCycle}
|
</if>
|
<if test="param.applyBasis != null and param.applyBasis != ''">
|
AND apply_basis = #{param.applyBasis}
|
</if>
|
<if test="param.shareType != null and param.shareType != ''">
|
AND share_type = #{param.shareType}
|
</if>
|
<if test="param.applicationScene != null and param.applicationScene != ''">
|
AND application_scene = #{param.applicationScene}
|
</if>
|
<if test="param.responsibleDeptId != null and param.responsibleDeptId != ''">
|
AND responsible_dept_id = #{param.responsibleDeptId}
|
</if>
|
<if test="param.applyTargetDeptId != null and param.applyTargetDeptId != ''">
|
AND apply_target_dept_id = #{param.applyTargetDeptId}
|
</if>
|
<if test="param.dataSource != null and param.dataSource != ''">
|
AND data_source = #{param.dataSource}
|
</if>
|
<if test="param.demandInfo != null and param.demandInfo != ''">
|
AND demand_info = #{param.demandInfo}
|
</if>
|
<if test="param.areaCode != null and param.areaCode != ''">
|
AND area_code = #{param.areaCode}
|
</if>
|
<if test="param.createUser != null">
|
AND create_user = #{param.createUser}
|
</if>
|
<if test="param.createDept != null">
|
AND create_dept = #{param.createDept}
|
</if>
|
<if test="param.createTime != null">
|
AND create_time = #{param.createTime}
|
</if>
|
<if test="param.updateUser != null">
|
AND update_user = #{param.updateUser}
|
</if>
|
<if test="param.updateTime != null">
|
AND update_time = #{param.updateTime}
|
</if>
|
<if test="param.status != null and param.status != ''">
|
AND status = #{param.status}
|
</if>
|
</sql>
|
|
<select id="selectGdSupplyDemandList" resultMap="gdSupplyDemandResultMap">
|
select * from ja_gd_supply_demand
|
<where>
|
is_deleted = 0
|
<include refid="gdSupplyDemandCondition"/>
|
</where>
|
</select>
|
|
<select id="selectGdSupplyDemandDetail" resultMap="gdSupplyDemandResultMap">
|
select * from ja_gd_supply_demand
|
<where>
|
is_deleted = 0
|
<include refid="gdSupplyDemandCondition"/>
|
<if test="deptIdList != null and deptIdList.size > 0">
|
AND (
|
create_dept IN
|
<foreach collection="deptIdList" item="deptId" open="(" separator="," close=")">
|
#{deptId}
|
</foreach>
|
OR apply_target_dept_id IN
|
<foreach collection="deptIdList" item="deptId" open="(" separator="," close=")">
|
#{deptId}
|
</foreach>
|
)
|
</if>
|
</where>
|
limit 1
|
</select>
|
|
<select id="selectGdSupplyDemandPage" resultMap="gdSupplyDemandVOResultMap">
|
select * from ja_gd_supply_demand
|
<where>
|
is_deleted = 0
|
<if test="param.demandName != null and param.demandName != ''">
|
AND demand_name LIKE CONCAT('%', #{param.demandName}, '%')
|
</if>
|
<if test="param.demandStatus != null and param.demandStatus != ''">
|
AND demand_status = #{param.demandStatus}
|
</if>
|
<if test="param.deptList != null and param.deptList.size > 0">
|
AND (
|
create_dept IN
|
<foreach collection="param.deptList" item="deptId" open="(" separator="," close=")">
|
#{deptId}
|
</foreach>
|
OR apply_target_dept_id IN
|
<foreach collection="param.deptList" item="deptId" open="(" separator="," close=")">
|
#{deptId}
|
</foreach>
|
)
|
</if>
|
</where>
|
</select>
|
|
<insert id="insertGdSupplyDemand" useGeneratedKeys="true" keyProperty="id">
|
insert into ja_gd_supply_demand (
|
demand_name,
|
demand_type,
|
contact_person,
|
contact_phone,
|
contact_email,
|
demand_status,
|
update_cycle,
|
apply_basis,
|
share_type,
|
application_scene,
|
responsible_dept_id,
|
apply_target_dept_id,
|
data_source,
|
demand_info,
|
area_code,
|
create_user,
|
create_dept,
|
update_user
|
) values (
|
#{demandName},
|
#{demandType},
|
#{contactPerson},
|
#{contactPhone},
|
#{contactEmail},
|
#{demandStatus},
|
#{updateCycle},
|
#{applyBasis},
|
#{shareType},
|
#{applicationScene},
|
#{responsibleDeptId},
|
#{applyTargetDeptId},
|
#{dataSource},
|
#{demandInfo},
|
#{areaCode},
|
#{createUser},
|
#{createDept},
|
#{updateUser}
|
)
|
</insert>
|
|
<update id="updateGdSupplyDemand">
|
update ja_gd_supply_demand
|
<set>
|
<if test="demandName != null">
|
demand_name = #{demandName},
|
</if>
|
<if test="demandType != null">
|
demand_type = #{demandType},
|
</if>
|
<if test="contactPerson != null">
|
contact_person = #{contactPerson},
|
</if>
|
<if test="contactPhone != null">
|
contact_phone = #{contactPhone},
|
</if>
|
<if test="contactEmail != null">
|
contact_email = #{contactEmail},
|
</if>
|
<if test="demandStatus != null">
|
demand_status = #{demandStatus},
|
</if>
|
<if test="updateCycle != null">
|
update_cycle = #{updateCycle},
|
</if>
|
<if test="applyBasis != null">
|
apply_basis = #{applyBasis},
|
</if>
|
<if test="shareType != null">
|
share_type = #{shareType},
|
</if>
|
<if test="applicationScene != null">
|
application_scene = #{applicationScene},
|
</if>
|
<if test="responsibleDeptId != null">
|
responsible_dept_id = #{responsibleDeptId},
|
</if>
|
<if test="applyTargetDeptId != null">
|
apply_target_dept_id = #{applyTargetDeptId},
|
</if>
|
<if test="dataSource != null">
|
data_source = #{dataSource},
|
</if>
|
<if test="demandInfo != null">
|
demand_info = #{demandInfo},
|
</if>
|
<if test="areaCode != null">
|
area_code = #{areaCode},
|
</if>
|
<if test="updateUser != null">
|
update_user = #{updateUser},
|
</if>
|
<if test="status != null">
|
status = #{status},
|
</if>
|
</set>
|
where id = #{id}
|
</update>
|
|
<select id="exportGdSupplyDemand" resultType="org.sxkj.gd.orderdata.excel.GdSupplyDemandExcel">
|
SELECT * FROM ja_gd_supply_demand ${ew.customSqlSegment}
|
</select>
|
|
</mapper>
|