73 lines
2.8 KiB
XML
73 lines
2.8 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.population.dao.populationlog.IPopulationLogDao">
|
|
|
|
<resultMap id="populationLogDTO" type="com.cm.population.pojo.dtos.populationlog.PopulationLogDTO">
|
|
<result column="population_info_id" property="populationInfoId"/>
|
|
<result column="population_log_id" property="populationLogId"/>
|
|
<result column="population_info_new_creator_name" property="populationInfoNewCreatorName"/>
|
|
<result column="population_info_new_creator" property="populationInfoNewCreator"/>
|
|
<result column="population_info_old_creator_name" property="populationInfoOldCreatorName"/>
|
|
<result column="population_info_old_creator" property="populationInfoOldCreator"/>
|
|
<result column="population_info_content" property="populationInfoContent"/>
|
|
<result column="population_info_data" property="populationInfoData"/>
|
|
<result column="creator" property="creator"/>
|
|
<result column="gmt_create" property="gmtCreate"/>
|
|
</resultMap>
|
|
|
|
<insert id="save" parameterType="map">
|
|
INSERT INTO population_population_log(
|
|
population_log_id,
|
|
population_info_id,
|
|
population_info_new_creator_name,
|
|
population_info_new_creator,
|
|
population_info_old_creator_name,
|
|
population_info_old_creator,
|
|
population_info_content,
|
|
population_info_data,
|
|
creator,
|
|
gmt_create
|
|
) VALUES(
|
|
#{populationLogId},
|
|
#{populationInfoId},
|
|
#{populationInfoNewCreatorName},
|
|
#{populationInfoNewCreator},
|
|
#{populationInfoOldCreatorName},
|
|
#{populationInfoOldCreator},
|
|
#{populationInfoContent},
|
|
#{populationInfoData},
|
|
#{creator},
|
|
#{gmtCreate}
|
|
)
|
|
</insert>
|
|
|
|
<select id="list" parameterType="map" resultMap="populationLogDTO">
|
|
SELECT
|
|
t1.population_info_id,
|
|
t1.population_log_id,
|
|
t1.population_info_new_creator_name,
|
|
t1.population_info_new_creator,
|
|
t1.population_info_old_creator_name,
|
|
t1.population_info_old_creator,
|
|
t1.population_info_content,
|
|
t1.population_info_data,
|
|
t1.creator,
|
|
t1.gmt_create
|
|
FROM
|
|
population_population_log t1
|
|
WHERE
|
|
t1.population_info_id = #{populationInfoId}
|
|
ORDER BY
|
|
t1.gmt_create DESC
|
|
</select>
|
|
|
|
<select id="count" parameterType="map" resultType="Integer">
|
|
SELECT
|
|
COUNT(*)
|
|
FROM
|
|
population_population_log t1
|
|
WHERE
|
|
t1.population_info_id = #{populationInfoId}
|
|
</select>
|
|
|
|
</mapper> |