btxtgxq-system-bigdata/src/main/resources/mybatis/mapper/kpi/kpi-khxz-zfga-mapper.xml
2024-04-22 15:38:34 +08:00

155 lines
4.4 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="com.cm.bigdata.dao.kpi.IKpiKhxzZfGaDao">
<resultMap id="kpiKhxzZfGaDTO" type="com.cm.bigdata.pojo.dtos.kpi.KpiKhxzZfGaDTO">
<result column="id" property="id"/>
<result column="department_id" property="departmentId"/>
<result column="user_id" property="userId"/>
<result column="user_username" property="userUsername"/>
<result column="kh_year" property="khYear"/>
<result column="kh_month" property="khMonth"/>
<result column="A" property="a"/>
<result column="B" property="b"/>
<result column="C" property="c"/>
<result column="D" property="d"/>
<result column="E" property="e"/>
<result column="F" property="f"/>
<result column="reasonF" property="reasonF"/>
<result column="G" property="g"/>
<result column="reasonG" property="reasonG"/>
<result column="H" property="h"/>
<result column="reasonH" property="reasonH"/>
<result column="I" property="i"/>
<result column="reasonI" property="reasonI"/>
<result column="J" property="j"/>
<result column="reasonJ" property="reasonJ"/>
<result column="K" property="k"/>
<result column="reasonK" property="reasonK"/>
<result column="L" property="l"/>
<result column="reasonL" property="reasonL"/>
<result column="M" property="m"/>
<result column="N" property="n"/>
<result column="O" property="o"/>
<result column="complex" property="complex"/>
</resultMap>
<insert id="save" parameterType="map">
INSERT INTO kpi_khxz_zf_ga (
department_id,
user_id,
user_username,
kh_year,
kh_month,
B
) VALUES (
#{departmentId},
#{userId},
#{userUsername},
#{khYear},
#{khMonth},
#{B}
)
</insert>
<delete id="delete" parameterType="map">
DELETE FROM
kpi_khxz_zf_ga
WHERE
kh_year = #{khYear}
AND
kh_month = #{khMonth}
</delete>
<select id="listUserId" parameterType="map" resultType="java.lang.String">
SELECT
user_id
FROM
kpi_khxz_zf_ga
WHERE
kh_year = #{khYear}
AND
kh_month = #{khMonth}
</select>
<update id="updateC" parameterType="map">
UPDATE
kpi_khxz_zf_ga
SET
C = #{C}
WHERE
kh_year = #{khYear}
AND
kh_month = #{khMonth}
AND
user_id = #{userId}
</update>
<update id="updateDEF" parameterType="map">
UPDATE
kpi_khxz_zf_ga
SET
D = #{D},
E = #{E},
F = #{F},
complex = #{complex}
WHERE
kh_year = #{khYear}
AND
kh_month = #{khMonth}
AND
user_id = #{userId}
</update>
<select id="list" parameterType="map" resultMap="kpiKhxzZfGaDTO">
SELECT
*
FROM
kpi_khxz_zf_ga
WHERE
kh_year = #{khYear}
AND
kh_month = #{khMonth}
<if test="departmentId != null and departmentId != ''">
AND
department_id = #{departmentId}
</if>
<if test="keywords != null and keywords != ''">
AND (
B LIKE CONCAT('%', #{keywords}, '%')
OR
user_username LIKE CONCAT('%', #{keywords}, '%')
)
</if>
</select>
<update id="update" parameterType="map">
UPDATE
kpi_khxz_zf_ga
SET
F = #{F},
reasonF = #{reasonF},
G = #{G},
reasonG = #{reasonG},
H = #{H},
reasonH = #{reasonH},
I = #{I},
reasonI = #{reasonI},
J = #{J},
reasonJ = #{reasonJ},
K = #{K},
reasonK = #{reasonK},
L = #{L},
reasonL = #{reasonL},
M = #{M},
N = #{N},
O = #{O}
WHERE
kh_year = #{khYear}
AND
kh_month = #{khMonth}
AND
user_id = #{userId}
</update>
</mapper>