|
@@ -4,12 +4,12 @@
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.boman.web.core.mapper.AccountingDataMapper">
|
|
<mapper namespace="com.boman.web.core.mapper.AccountingDataMapper">
|
|
|
|
|
|
- <resultMap type="AccountingData" id="AccountingDataResult">
|
|
|
|
|
|
+ <resultMap type="com.boman.web.core.domain.vo.AccountingDataVo" id="AccountingDataResult">
|
|
<result property="id" column="id"/>
|
|
<result property="id" column="id"/>
|
|
<result property="jcsj" column="jcsj"/>
|
|
<result property="jcsj" column="jcsj"/>
|
|
<result property="lxdh" column="lxdh"/>
|
|
<result property="lxdh" column="lxdh"/>
|
|
<result property="address" column="address"/>
|
|
<result property="address" column="address"/>
|
|
- <result property="batcNumber" column="batch_number"/>
|
|
|
|
|
|
+ <result property="batchNumber" column="batch_number"/>
|
|
<result property="focusPerson" column="focus_person"/>
|
|
<result property="focusPerson" column="focus_person"/>
|
|
<result property="jcjg" column="jcjg"/>
|
|
<result property="jcjg" column="jcjg"/>
|
|
<result property="fromCity" column="from_city"/>
|
|
<result property="fromCity" column="from_city"/>
|
|
@@ -60,45 +60,96 @@
|
|
<select id="selectAccountingDataHjList" parameterType="com.boman.web.core.domain.vo.AccountingDataVo"
|
|
<select id="selectAccountingDataHjList" parameterType="com.boman.web.core.domain.vo.AccountingDataVo"
|
|
resultMap="AccountingDataResult">
|
|
resultMap="AccountingDataResult">
|
|
SELECT
|
|
SELECT
|
|
- r.id,r.user_name,r.id_card as zjhm,r.province,r.city,r.region,r.village_towns,r.village,r.now_in,r.phone_num,d.lxdh,d.jcsj,d.jcdd
|
|
|
|
|
|
+ r.id,r.user_name as xm,r.id_card as zjhm,r.province,r.city,r.region,r.village_towns,r.village,r.now_in,r.phone_num,d.lxdh,d.jcsj,d.jcdd,d.cjdd,d.cjsj
|
|
FROM czrk r left join `accounting_data` d on r.id_card = d.zjhm
|
|
FROM czrk r left join `accounting_data` d on r.id_card = d.zjhm
|
|
<where>
|
|
<where>
|
|
r.is_del = 'N'
|
|
r.is_del = 'N'
|
|
and r.status = '1'
|
|
and r.status = '1'
|
|
and d.is_del = 'N'
|
|
and d.is_del = 'N'
|
|
- <if test="idCard != null and idCard != ''">and r.id_card = #{idCard}</if>
|
|
|
|
- <if test="userName != null and userName != ''">and r.user_name like concat(#{userName}, '%')</if>
|
|
|
|
- <if test="params.startTime != null and params.startTime != ''">and DATE_FORMAT(d.jcsj,'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT(#{params.startTime},'%Y-%m-%d %H:%i:%s')</if>
|
|
|
|
- <if test="params.endTime != null and params.endTime != ''">and DATE_FORMAT(d.jcsj,'%Y-%m-%d %H:%i:%s') <= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')</if>
|
|
|
|
- <if test="isNucleicAcid != null and isNucleicAcid != '' and isNucleicAcid == 'N'">and DATE_FORMAT(d.jcsj,'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT('1900-01-01 00:00:00','%Y-%m-%d %H:%i:%s')</if>
|
|
|
|
|
|
+ <if test="zjhm != null and zjhm != ''">and r.id_card = #{zjhm}</if>
|
|
|
|
+ <if test="xm != null and xm != ''">and r.user_name like concat(#{xm}, '%')</if>
|
|
|
|
+ <if test="params.startTime != null and params.startTime != ''">and DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT(#{params.startTime},'%Y-%m-%d %H:%i:%s')</if>
|
|
|
|
+ <if test="params.endTime != null and params.endTime != ''">and DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') <= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')</if>
|
|
|
|
+ <if test="isNucleicAcid != null and isNucleicAcid != ''">and r.is_nucleicAcid = #{isNucleicAcid}</if>
|
|
<if test="provinceId != null and provinceId != ''">and r.province_id = #{provinceId}</if>
|
|
<if test="provinceId != null and provinceId != ''">and r.province_id = #{provinceId}</if>
|
|
<if test="cityId != null and cityId != ''">and r.city_id = #{cityId}</if>
|
|
<if test="cityId != null and cityId != ''">and r.city_id = #{cityId}</if>
|
|
<if test="regionId != null and regionId != ''">and r.region_id = #{regionId}</if>
|
|
<if test="regionId != null and regionId != ''">and r.region_id = #{regionId}</if>
|
|
<if test="villageTownsId != null and villageTownsId != ''">and r.village_towns_id = #{villageTownsId}</if>
|
|
<if test="villageTownsId != null and villageTownsId != ''">and r.village_towns_id = #{villageTownsId}</if>
|
|
<if test="villageId != null and villageId != ''">and r.village_id = #{villageId}</if>
|
|
<if test="villageId != null and villageId != ''">and r.village_id = #{villageId}</if>
|
|
</where>
|
|
</where>
|
|
|
|
+ order by d.jcsj DESC
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="selectAccountingDataJzdzList" parameterType="com.boman.web.core.domain.vo.AccountingDataVo"
|
|
<select id="selectAccountingDataJzdzList" parameterType="com.boman.web.core.domain.vo.AccountingDataVo"
|
|
resultMap="AccountingDataResult">
|
|
resultMap="AccountingDataResult">
|
|
- select r.user_name, r.phone_num, r.id_card as zjhm,
|
|
|
|
- z.province as provinceXjd , z.city as cityXjd,z.region as regionXjd , z.town as villageTownsXjd, z.village as villageXjd,z.now_in as nowXjd,d.lxdh,d.jcsj,d.jcdd
|
|
|
|
|
|
+ select r.user_name as xm, r.phone_num, r.id_card as zjhm,
|
|
|
|
+ z.province as provinceXjd , z.city as cityXjd,z.region as regionXjd , z.town as villageTownsXjd, z.village as villageXjd,z.now_in,d.lxdh,d.jcsj,d.jcdd,d.cjdd,d.cjsj
|
|
from czrk r left join czrk_jzdz z on r.id =z.czrk_id
|
|
from czrk r left join czrk_jzdz z on r.id =z.czrk_id
|
|
left join `accounting_data` d on r.id_card = d.zjhm
|
|
left join `accounting_data` d on r.id_card = d.zjhm
|
|
<where>
|
|
<where>
|
|
r.is_del = 'N'
|
|
r.is_del = 'N'
|
|
and r.status = '1'
|
|
and r.status = '1'
|
|
and d.is_del = 'N'
|
|
and d.is_del = 'N'
|
|
- <if test="idCard != null and idCard != ''">and r.id_card = #{idCard}</if>
|
|
|
|
- <if test="userName != null and userName != ''">and r.user_name like concat(#{userName}, '%')</if>
|
|
|
|
- <if test="params.startTime != null and params.startTime != ''">and DATE_FORMAT(d.jcsj,'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT(#{params.startTime},'%Y-%m-%d %H:%i:%s')</if>
|
|
|
|
- <if test="params.endTime != null and params.endTime != ''">and DATE_FORMAT(d.jcsj,'%Y-%m-%d %H:%i:%s') <= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')</if>
|
|
|
|
- <if test="isNucleicAcid != null and isNucleicAcid != ''">and DATE_FORMAT(d.jcsj,'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT('1900-01-01 00:00:00','%Y-%m-%d %H:%i:%s')</if>
|
|
|
|
|
|
+ <if test="zjhm != null and zjhm != ''">and r.id_card = #{zjhm}</if>
|
|
|
|
+ <if test="xm != null and xm != ''">and r.user_name like concat(#{xm}, '%')</if>
|
|
|
|
+ <if test="params.startTime != null and params.startTime != ''">and DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT(#{params.startTime},'%Y-%m-%d %H:%i:%s')</if>
|
|
|
|
+ <if test="params.endTime != null and params.endTime != ''">and DATE_FORMAT(d.cjsj,'%Y-%m-%d %H:%i:%s') <= DATE_FORMAT(#{params.endTime},'%Y-%m-%d %H:%i:%s')</if>
|
|
|
|
+ <if test="isNucleicAcid != null and isNucleicAcid != ''">and r.is_nucleicAcid = #{isNucleicAcid}</if>
|
|
<if test="provinceIdXjd != null and provinceIdXjd != ''">and z.province_id = #{provinceIdXjd}</if>
|
|
<if test="provinceIdXjd != null and provinceIdXjd != ''">and z.province_id = #{provinceIdXjd}</if>
|
|
<if test="cityIdXjd != null and cityIdXjd != ''">and z.city_id = #{cityIdXjd}</if>
|
|
<if test="cityIdXjd != null and cityIdXjd != ''">and z.city_id = #{cityIdXjd}</if>
|
|
<if test="regionIdXjd != null and regionIdXjd != ''">and z.region_id = #{regionIdXjd}</if>
|
|
<if test="regionIdXjd != null and regionIdXjd != ''">and z.region_id = #{regionIdXjd}</if>
|
|
<if test="villageTownsIdXjd != null and villageTownsIdXjd != ''">and z.town_id = #{villageTownsIdXjd}</if>
|
|
<if test="villageTownsIdXjd != null and villageTownsIdXjd != ''">and z.town_id = #{villageTownsIdXjd}</if>
|
|
<if test="villageIdXjd != null and villageIdXjd != ''">and z.village_id = #{villageIdXjd}</if>
|
|
<if test="villageIdXjd != null and villageIdXjd != ''">and z.village_id = #{villageIdXjd}</if>
|
|
</where>
|
|
</where>
|
|
|
|
+ order by d.jcsj DESC
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <insert id="insertAccountingData" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
+ insert into accounting_data
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="id != null">id,</if>
|
|
|
|
+ <if test="jcsj != null">jcsj,</if>
|
|
|
|
+ <if test="lxdh != null">lxdh,</if>
|
|
|
|
+ <if test="address != null">address,</if>
|
|
|
|
+ <if test="batchNumber != null">batch_number,</if>
|
|
|
|
+ <if test="focusPerson != null">focus_person,</if>
|
|
|
|
+ <if test="jcjg != null">jcjg,</if>
|
|
|
|
+ <if test="fromCity != null">from_city,</if>
|
|
|
|
+ <if test="jcdd != null">jcdd,</if>
|
|
|
|
+ <if test="cjdd != null">cjdd,</if>
|
|
|
|
+ <if test="toCity != null">to_city,</if>
|
|
|
|
+ <if test="source != null">source,</if>
|
|
|
|
+ <if test="zjhm != null">zjhm,</if>
|
|
|
|
+ <if test="cjsj != null">cjsj,</if>
|
|
|
|
+ <if test="certificateNoType != null">certificate_no_type,</if>
|
|
|
|
+ <if test="xm != null">xm,</if>
|
|
|
|
+ <if test="collectorName != null">collector_name,</if>
|
|
|
|
+ <if test="cjssxq != null">cjssxq,</if>
|
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
|
+ create_time
|
|
|
|
+ </trim>
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="id != null">#{id},</if>
|
|
|
|
+ <if test="lxdh != null">#{lxdh},</if>
|
|
|
|
+ <if test="address != null">#{address},</if>
|
|
|
|
+ <if test="batchNumber != null">#{batchNumber},</if>
|
|
|
|
+ <if test="focusPerson != null">#{focusPerson},</if>
|
|
|
|
+ <if test="jcjg != null">#{jcjg},</if>
|
|
|
|
+ <if test="fromCity != null">#{fromCity},</if>
|
|
|
|
+ <if test="jcdd != null">#{jcdd},</if>
|
|
|
|
+ <if test="cjdd != null">#{cjdd},</if>
|
|
|
|
+ <if test="toCity != null">#{toCity},</if>
|
|
|
|
+ <if test="source != null">#{source},</if>
|
|
|
|
+ <if test="zjhm != null">#{zjhm},</if>
|
|
|
|
+ <if test="cjsj != null">#{cjsj},</if>
|
|
|
|
+ <if test="certificateNoType != null">#{certificateNoType},</if>
|
|
|
|
+ <if test="workUnit != null">#{workUnit},</if>
|
|
|
|
+ <if test="xm != null">#{xm},</if>
|
|
|
|
+ <if test="collectorName != null">#{collectorName},</if>
|
|
|
|
+ <if test="cjssxq != null">#{cjssxq},</if>
|
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
|
+ sysdate()
|
|
|
|
+ </trim>
|
|
|
|
+ </insert>
|
|
</mapper>
|
|
</mapper>
|