| | |
| | | <result column="operate_time" jdbcType="TIMESTAMP" property="operateDt" /> |
| | | <result column="deleted" jdbcType="TINYINT" property="deleted" /> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, project_name, province_id, city_id, county_id, town_id, `village_id`, project_state, remarks, `operator`, |
| | | operate_time, deleted |
| | | </sql> |
| | | <!--添加--> |
| | | <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoIr.IrProject"> |
| | | <!--@mbg.generated--> |
| | | insert into ir_project |
| | |
| | | on dis_vil.supperId = dis_tow.id |
| | | where dis_vil.id = #{vaId,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <!--逻辑删除--> |
| | | <delete id="deleteLogicById" parameterType="java.lang.Long"> |
| | | <!--@mbg.generated--> |
| | | update ir_project |
| | | set deleted = 1 |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <!--修改信息--> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoIr.IrProject"> |
| | | update ir_project |
| | | <set> |
| | | <if test="projectName != null"> |
| | | project_name = #{projectName,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="provinceId != null"> |
| | | province_id = #{provinceId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="cityId != null"> |
| | | city_id = #{cityId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="countyId != null"> |
| | | county_id = #{countyId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="townId != null"> |
| | | town_id = #{townId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="villageId != null"> |
| | | village_id = #{villageId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="projectState != null"> |
| | | project_state = #{projectState,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="remarks != null"> |
| | | remarks = #{remarks,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="operator != null"> |
| | | operator = #{operator,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="operateDt != null"> |
| | | operate_time = #{operateDt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted = #{deleted,jdbcType=TINYINT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <!--修改状态--> |
| | | <update id="updateProjectState"> |
| | | update ir_project |
| | | set project_state = #{projectState,jdbcType=TINYINT}, |
| | | operator = #{operator,jdbcType=BIGINT}, |
| | | operate_time = #{operateDt,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <!--查询一个信息--> |
| | | <select id="selectById" resultType="com.dy.pipIrrGlobal.voIr.VoProjectOne"> |
| | | select |
| | | CAST(pro.id AS char)AS id, |
| | | CAST(pro.province_id AS char)AS provinceId, |
| | | CAST(pro.city_id AS char)AS cityId, |
| | | CAST(pro.county_id AS char)AS countyId, |
| | | CAST(pro.town_id AS char)AS townId, |
| | | CAST(pro.village_id AS char)AS villageId, |
| | | pro.project_name AS projectName, |
| | | pro.project_state AS projectState, |
| | | cli.name AS operatorName, |
| | | pro.remarks, |
| | | pro.operate_time AS operateDt |
| | | from ir_project pro |
| | | left join se_client cli on cli.id = pro.operator |
| | | where pro.id = #{id,jdbcType=BIGINT} and pro.deleted = 0 |
| | | </select> |
| | | <!--分页查询数量--> |
| | | <select id="getRecordCount" resultType="java.lang.Long"> |
| | | SELECT COUNT(*) AS recordCount |
| | | FROM ir_project pro |
| | | <where> |
| | | pro.deleted = 0 |
| | | <if test="projectName != null and projectName != ''"> |
| | | AND pro.project_name LIKE CONCAT('%', #{projectName}, '%') |
| | | </if> |
| | | <if test = "projectState != null and projectState != ''"> |
| | | AND pro.project_state = #{projectState} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <!--分页查询数据--> |
| | | <select id="getProjects" resultType="com.dy.pipIrrGlobal.voIr.VoProject"> |
| | | SELECT |
| | | CAST(pro.id AS char)AS projectId, |
| | | pro.project_name AS projectName, |
| | | pro.project_state AS projectState, |
| | | CONCAT(province.`name`,city.`name`,country.`name`, town.`name`, village.`name`) AS address, |
| | | pro.remarks, |
| | | pro.operate_time AS operateDt |
| | | FROM ir_project pro |
| | | LEFT JOIN ba_district province ON pro.province_id = province.id |
| | | LEFT JOIN ba_district city ON pro.city_id = city.id |
| | | LEFT JOIN ba_district country ON pro.county_id = country.id |
| | | LEFT JOIN ba_district town ON pro.town_id = town.id |
| | | LEFT JOIN ba_district village ON pro.village_id = village.id |
| | | <where> |
| | | pro.deleted = 0 |
| | | <if test="projectName != null and projectName != ''"> |
| | | AND pro.project_name LIKE CONCAT('%', #{projectName}, '%') |
| | | </if> |
| | | <if test = "projectState != null and projectState != ''"> |
| | | AND pro.project_state = #{projectState} |
| | | </if> |
| | | </where> |
| | | ORDER BY pro.operate_time DESC |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${(pageCurr-1)*pageSize}, ${pageSize} |
| | | </if> |
| | | </select> |
| | | </mapper> |