350 lines
12 KiB
XML
350 lines
12 KiB
XML
|
<?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="cn.com.tenlion.dao.classplan.IClassPlanDao">
|
||
|
|
||
|
<resultMap id="classPlanDTO" type="cn.com.tenlion.pojo.dtos.classplan.ClassPlanDTO">
|
||
|
<result column="plan_number" property="planNumber"/>
|
||
|
<result column="plan_name" property="planName"/>
|
||
|
<result column="plan_type" property="planType"/>
|
||
|
<result column="project_catalog_id" property="projectCatalogId"/>
|
||
|
<result column="worker_catalog" property="workerCatalog"/>
|
||
|
<result column="plan_person_num" property="planPersonNum"/>
|
||
|
<result column="plan_start_time" property="planStartTime"/>
|
||
|
<result column="plan_end_time" property="planEndTime"/>
|
||
|
<result column="sign_up_start_time" property="signUpStartTime"/>
|
||
|
<result column="sign_up_end_time" property="signUpEndTime"/>
|
||
|
<result column="plan_address" property="planAddress"/>
|
||
|
<result column="charge_person" property="chargePerson"/>
|
||
|
<result column="charge_person_tel" property="chargePersonTel"/>
|
||
|
</resultMap>
|
||
|
|
||
|
<resultMap id="classPlanBO" type="cn.com.tenlion.pojo.bos.classplan.ClassPlanBO">
|
||
|
<result column="class_plan_id" property="classPlanId"/>
|
||
|
<result column="plan_number" property="planNumber"/>
|
||
|
<result column="plan_name" property="planName"/>
|
||
|
<result column="plan_type" property="planType"/>
|
||
|
<result column="project_catalog_id" property="projectCatalogId"/>
|
||
|
<result column="worker_catalog" property="workerCatalog"/>
|
||
|
<result column="plan_person_num" property="planPersonNum"/>
|
||
|
<result column="plan_start_time" property="planStartTime"/>
|
||
|
<result column="plan_end_time" property="planEndTime"/>
|
||
|
<result column="sign_up_start_time" property="signUpStartTime"/>
|
||
|
<result column="sign_up_end_time" property="signUpEndTime"/>
|
||
|
<result column="plan_address" property="planAddress"/>
|
||
|
<result column="charge_person" property="chargePerson"/>
|
||
|
<result column="charge_person_tel" property="chargePersonTel"/>
|
||
|
</resultMap>
|
||
|
|
||
|
<resultMap id="classPlanPO" type="cn.com.tenlion.pojo.pos.classplan.ClassPlanPO">
|
||
|
<result column="class_plan_id" property="classPlanId"/>
|
||
|
<result column="plan_number" property="planNumber"/>
|
||
|
<result column="plan_name" property="planName"/>
|
||
|
<result column="plan_type" property="planType"/>
|
||
|
<result column="project_catalog_id" property="projectCatalogId"/>
|
||
|
<result column="worker_catalog" property="workerCatalog"/>
|
||
|
<result column="plan_person_num" property="planPersonNum"/>
|
||
|
<result column="plan_start_time" property="planStartTime"/>
|
||
|
<result column="plan_end_time" property="planEndTime"/>
|
||
|
<result column="sign_up_start_time" property="signUpStartTime"/>
|
||
|
<result column="sign_up_end_time" property="signUpEndTime"/>
|
||
|
<result column="plan_address" property="planAddress"/>
|
||
|
<result column="charge_person" property="chargePerson"/>
|
||
|
<result column="charge_person_tel" property="chargePersonTel"/>
|
||
|
</resultMap>
|
||
|
|
||
|
<!-- 新增 -->
|
||
|
<insert id="save" parameterType="map">
|
||
|
INSERT INTO e_class_plan(
|
||
|
class_plan_id,
|
||
|
plan_number,
|
||
|
plan_name,
|
||
|
plan_type,
|
||
|
project_catalog_id,
|
||
|
worker_catalog,
|
||
|
plan_person_num,
|
||
|
plan_start_time,
|
||
|
plan_end_time,
|
||
|
sign_up_start_time,
|
||
|
sign_up_end_time,
|
||
|
plan_address,
|
||
|
charge_person,
|
||
|
charge_person_tel
|
||
|
) VALUES(
|
||
|
#{classPlanId},
|
||
|
#{planNumber},
|
||
|
#{planName},
|
||
|
#{planType},
|
||
|
#{projectCatalogId},
|
||
|
#{workerCatalog},
|
||
|
#{planPersonNum},
|
||
|
#{planStartTime},
|
||
|
#{planEndTime},
|
||
|
#{signUpStartTime},
|
||
|
#{signUpEndTime},
|
||
|
#{planAddress},
|
||
|
#{chargePerson},
|
||
|
#{chargePersonTel}
|
||
|
)
|
||
|
</insert>
|
||
|
|
||
|
|
||
|
<!-- 删除(物理) -->
|
||
|
<update id="delete" parameterType="map">
|
||
|
DELETE FROM
|
||
|
e_class_plan
|
||
|
WHERE
|
||
|
class_plan_id IN
|
||
|
<foreach collection="classPlanIds" index="index" open="(" separator="," close=")">
|
||
|
#{classPlanIds[${index}]}
|
||
|
</foreach>
|
||
|
</update>
|
||
|
|
||
|
<!-- 修改 -->
|
||
|
<update id="update" parameterType="map">
|
||
|
UPDATE
|
||
|
e_class_plan
|
||
|
SET
|
||
|
<if test="planNumber != null and planNumber != ''">
|
||
|
plan_number = #{planNumber},
|
||
|
</if>
|
||
|
<if test="planName != null and planName != ''">
|
||
|
plan_name = #{planName},
|
||
|
</if>
|
||
|
<if test="planType != null and planType != ''">
|
||
|
plan_type = #{planType},
|
||
|
</if>
|
||
|
<if test="projectCatalogId != null and projectCatalogId != ''">
|
||
|
project_catalog_id = #{projectCatalogId},
|
||
|
</if>
|
||
|
<if test="workerCatalog != null and workerCatalog != ''">
|
||
|
worker_catalog = #{workerCatalog},
|
||
|
</if>
|
||
|
<if test="planPersonNum != null">
|
||
|
plan_person_num = #{planPersonNum},
|
||
|
</if>
|
||
|
<if test="planStartTime != null and planStartTime != ''">
|
||
|
plan_start_time = #{planStartTime},
|
||
|
</if>
|
||
|
<if test="planEndTime != null and planEndTime != ''">
|
||
|
plan_end_time = #{planEndTime},
|
||
|
</if>
|
||
|
<if test="signUpStartTime != null and signUpStartTime != ''">
|
||
|
sign_up_start_time = #{signUpStartTime},
|
||
|
</if>
|
||
|
<if test="signUpEndTime != null and signUpEndTime != ''">
|
||
|
sign_up_end_time = #{signUpEndTime},
|
||
|
</if>
|
||
|
<if test="planAddress != null and planAddress != ''">
|
||
|
plan_address = #{planAddress},
|
||
|
</if>
|
||
|
<if test="chargePerson != null and chargePerson != ''">
|
||
|
charge_person = #{chargePerson},
|
||
|
</if>
|
||
|
<if test="chargePersonTel != null and chargePersonTel != ''">
|
||
|
charge_person_tel = #{chargePersonTel},
|
||
|
</if>
|
||
|
class_plan_id = class_plan_id
|
||
|
WHERE
|
||
|
class_plan_id = #{classPlanId}
|
||
|
</update>
|
||
|
|
||
|
<!-- 详情 -->
|
||
|
<select id="get" parameterType="map" resultMap="classPlanDTO">
|
||
|
SELECT
|
||
|
t1.plan_number,
|
||
|
t1.plan_name,
|
||
|
t1.plan_type,
|
||
|
t1.project_catalog_id,
|
||
|
t1.worker_catalog,
|
||
|
t1.plan_person_num,
|
||
|
t1.plan_start_time,
|
||
|
t1.plan_end_time,
|
||
|
t1.sign_up_start_time,
|
||
|
t1.sign_up_end_time,
|
||
|
t1.plan_address,
|
||
|
t1.charge_person,
|
||
|
t1.charge_person_tel,
|
||
|
t1.class_plan_id
|
||
|
FROM
|
||
|
e_class_plan t1
|
||
|
WHERE
|
||
|
1 = 1
|
||
|
<if test="classPlanId != null and classPlanId != ''">
|
||
|
AND
|
||
|
t1.class_plan_id = #{classPlanId}
|
||
|
</if>
|
||
|
</select>
|
||
|
|
||
|
<!-- 详情 -->
|
||
|
<select id="getBO" parameterType="map" resultMap="classPlanBO">
|
||
|
SELECT
|
||
|
t1.class_plan_id,
|
||
|
t1.plan_number,
|
||
|
t1.plan_name,
|
||
|
t1.plan_type,
|
||
|
t1.project_catalog_id,
|
||
|
t1.worker_catalog,
|
||
|
t1.plan_person_num,
|
||
|
t1.plan_start_time,
|
||
|
t1.plan_end_time,
|
||
|
t1.sign_up_start_time,
|
||
|
t1.sign_up_end_time,
|
||
|
t1.plan_address,
|
||
|
t1.charge_person,
|
||
|
t1.charge_person_tel
|
||
|
FROM
|
||
|
e_class_plan t1
|
||
|
WHERE
|
||
|
1 = 1
|
||
|
<if test="classPlanId != null and classPlanId != ''">
|
||
|
AND
|
||
|
t1.class_plan_id = #{classPlanId}
|
||
|
</if>
|
||
|
</select>
|
||
|
|
||
|
<!-- 详情 -->
|
||
|
<select id="getPO" parameterType="map" resultMap="classPlanPO">
|
||
|
SELECT
|
||
|
t1.class_plan_id,
|
||
|
t1.plan_number,
|
||
|
t1.plan_name,
|
||
|
t1.plan_type,
|
||
|
t1.project_catalog_id,
|
||
|
t1.worker_catalog,
|
||
|
t1.plan_person_num,
|
||
|
t1.plan_start_time,
|
||
|
t1.plan_end_time,
|
||
|
t1.sign_up_start_time,
|
||
|
t1.sign_up_end_time,
|
||
|
t1.plan_address,
|
||
|
t1.charge_person,
|
||
|
t1.charge_person_tel
|
||
|
FROM
|
||
|
e_class_plan t1
|
||
|
WHERE
|
||
|
1 = 1
|
||
|
<if test="classPlanId != null and classPlanId != ''">
|
||
|
AND
|
||
|
t1.class_plan_id = #{classPlanId}
|
||
|
</if>
|
||
|
</select>
|
||
|
|
||
|
<!-- 列表 -->
|
||
|
<select id="list" parameterType="map" resultMap="classPlanDTO">
|
||
|
SELECT
|
||
|
t1.plan_number,
|
||
|
t1.plan_name,
|
||
|
t1.plan_type,
|
||
|
t1.project_catalog_id,
|
||
|
t1.worker_catalog,
|
||
|
t1.plan_person_num,
|
||
|
t1.plan_start_time,
|
||
|
t1.plan_end_time,
|
||
|
t1.sign_up_start_time,
|
||
|
t1.sign_up_end_time,
|
||
|
t1.plan_address,
|
||
|
t1.charge_person,
|
||
|
t1.charge_person_tel,
|
||
|
1
|
||
|
FROM
|
||
|
e_class_plan t1
|
||
|
WHERE
|
||
|
1 = 1
|
||
|
<if test="keywords != null and keywords != ''">
|
||
|
AND (
|
||
|
<!-- 这里添加其他条件 -->
|
||
|
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
||
|
)
|
||
|
</if>
|
||
|
<if test="classPlanIds != null and classPlanIds.size > 0">
|
||
|
AND
|
||
|
t1.class_plan_id IN
|
||
|
<foreach collection="classPlanIds" index="index" open="(" separator="," close=")">
|
||
|
#{classPlanIds[${index}]}
|
||
|
</foreach>
|
||
|
</if>
|
||
|
</select>
|
||
|
|
||
|
<!-- 列表 -->
|
||
|
<select id="listBO" parameterType="map" resultMap="classPlanBO">
|
||
|
SELECT
|
||
|
t1.class_plan_id,
|
||
|
t1.plan_number,
|
||
|
t1.plan_name,
|
||
|
t1.plan_type,
|
||
|
t1.project_catalog_id,
|
||
|
t1.worker_catalog,
|
||
|
t1.plan_person_num,
|
||
|
t1.plan_start_time,
|
||
|
t1.plan_end_time,
|
||
|
t1.sign_up_start_time,
|
||
|
t1.sign_up_end_time,
|
||
|
t1.plan_address,
|
||
|
t1.charge_person,
|
||
|
t1.charge_person_tel
|
||
|
FROM
|
||
|
e_class_plan t1
|
||
|
WHERE
|
||
|
1 = 1
|
||
|
<if test="keywords != null and keywords != ''">
|
||
|
AND (
|
||
|
<!-- 这里添加其他条件 -->
|
||
|
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
||
|
)
|
||
|
</if>
|
||
|
<if test="classPlanIds != null and classPlanIds.size > 0">
|
||
|
AND
|
||
|
t1.class_plan_id IN
|
||
|
<foreach collection="classPlanIds" index="index" open="(" separator="," close=")">
|
||
|
#{classPlanIds[${index}]}
|
||
|
</foreach>
|
||
|
</if>
|
||
|
</select>
|
||
|
|
||
|
<!-- 列表 -->
|
||
|
<select id="listPO" parameterType="map" resultMap="classPlanPO">
|
||
|
SELECT
|
||
|
t1.class_plan_id,
|
||
|
t1.plan_number,
|
||
|
t1.plan_name,
|
||
|
t1.plan_type,
|
||
|
t1.project_catalog_id,
|
||
|
t1.worker_catalog,
|
||
|
t1.plan_person_num,
|
||
|
t1.plan_start_time,
|
||
|
t1.plan_end_time,
|
||
|
t1.sign_up_start_time,
|
||
|
t1.sign_up_end_time,
|
||
|
t1.plan_address,
|
||
|
t1.charge_person,
|
||
|
t1.charge_person_tel
|
||
|
FROM
|
||
|
e_class_plan t1
|
||
|
WHERE
|
||
|
1 = 1
|
||
|
<if test="keywords != null and keywords != ''">
|
||
|
AND (
|
||
|
<!-- 这里添加其他条件 -->
|
||
|
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
||
|
)
|
||
|
</if>
|
||
|
<if test="classPlanIds != null and classPlanIds.size > 0">
|
||
|
AND
|
||
|
t1.class_plan_id IN
|
||
|
<foreach collection="classPlanIds" index="index" open="(" separator="," close=")">
|
||
|
#{classPlanIds[${index}]}
|
||
|
</foreach>
|
||
|
</if>
|
||
|
</select>
|
||
|
|
||
|
<!-- 统计 -->
|
||
|
<select id="count" parameterType="map" resultType="Integer">
|
||
|
SELECT
|
||
|
COUNT(*)
|
||
|
FROM
|
||
|
e_class_plan t1
|
||
|
WHERE
|
||
|
1 = 1
|
||
|
</select>
|
||
|
|
||
|
</mapper>
|